none
blank date field

    Question

  • good day to the experts

    i never use a blank date field since, but this time i was asked by my client that a blank date field should be shown if there is no payment made.

    in vfp there is no problem, but when i saved it from vfp record to ms sql2000 record, when i refresh the form and or open the table at ms sql server the blank date field has already a date added in blank field "01/01/1900" is vfp has nothing to do with it?

    thanks for any help regarding this matter
    .madix_t
    Saturday, November 21, 2009 12:13 PM

Answers

  • Set your date field to accept NULL and for a "blank" date set it to a null.

    Saturday, November 21, 2009 6:52 PM
  • 1. Try to change your SQL Date Field as (Nullable)
    2. SQL Data is not a matter, store to a cursor and can do the works...Am I correct?

    U.PARANTHAMAN
    Saturday, November 21, 2009 3:05 PM

All replies

  • Hi Madix
    Simply you can have a comparitive date & Empty date like the below

    store ctod('  /  /    ') to Null_Date,Disp_date
    store ctod('01/01/1900') to Comp_date

    if MyTable.Date_Field=Comp_date  then
       Disp_Date=Null_date
    else
      Disp_date=MyTable.Date_Field
    endif

     

     


    U.PARANTHAMAN
    Saturday, November 21, 2009 12:45 PM
  • thanks paramu for your immediate reply.

    but it works only in vfp local table but not in ms sql server


    .madix_t
    Saturday, November 21, 2009 12:57 PM
  • 1. Try to change your SQL Date Field as (Nullable)
    2. SQL Data is not a matter, store to a cursor and can do the works...Am I correct?

    U.PARANTHAMAN
    Saturday, November 21, 2009 3:05 PM
  • Set your date field to accept NULL and for a "blank" date set it to a null.

    Saturday, November 21, 2009 6:52 PM
  • thank you very very much to both of you paramu & cetinBasoz, now it works...

    again thank you
    .madix_t
    Saturday, November 21, 2009 11:57 PM