Alpha Video Training
Results 1 to 6 of 6

Thread: V10 Conditional Style - how to reference a empty date?

  1. #1
    Member
    Real Name
    Michael Scholin
    Join Date
    May 2007
    Location
    Madison, WI
    Posts
    321

    Default V10 Conditional Style - how to reference a empty date?

    Using the conditional styles in V10 with a grid field is amazing but I can not figure out how to reference a date field with a logical expression if it is empty (it displays "00/00/00" on my screen).

    I am not sure if I am dealing with xbasic, javascript or what but I have tried many different combinations.

    Has anyone tried this yet and if so what is the proper syntax to use?

    It has to be something like datefield={} but I don't know what to replace the {} with.

    Thanks!

  2. #2
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,629

    Default Re: V10 Conditional Style - how to reference a empty date?

    John,

    If you are using dbf tables, then that 00/00/00 is actually a valid date, so it is not empty, it is just long ago. So, one solution is to look for dates less than 1900, or what ever is long enough ago.

    If you are using SQL, then the date might actually be null, and you can use SQL functions to test for that.

    Pat

  3. #3
    Member
    Real Name
    Jim Coltz
    Join Date
    Oct 2005
    Location
    Western Pennsylvania
    Posts
    600

    Default Re: V10 Conditional Style - how to reference a empty date?

    Quote Originally Posted by Scholin View Post
    Using the conditional styles in V10 with a grid field is amazing but I can not figure out how to reference a date field with a logical expression if it is empty (it displays "00/00/00" on my screen).

    I am not sure if I am dealing with xbasic, javascript or what but I have tried many different combinations.

    Has anyone tried this yet and if so what is the proper syntax to use?

    It has to be something like datefield={} but I don't know what to replace the {} with.

    Thanks!
    datefield = {} is valid for testing for an empty date field in a dbf table. I'm assuming you have a date format set in the grid field's dispay format properties. If so and you don't want to see the blank records as 00/00/00 you can create a conditional style for the field with a logical test of datefield ={} and then set the font color to match the background color of the field. In essence making the text invisible.

    I did try to suppress the display of the 00/00/00 for empty fields using the display format property but the format builder does not seem to allow an if/then type test.

  4. #4
    Member
    Real Name
    Michael Scholin
    Join Date
    May 2007
    Location
    Madison, WI
    Posts
    321

    Default Re: V10 Conditional Style - how to reference a empty date?

    I am not sure my using SQL as the back end had affected this or not but what finally did work in this conditional expression was using:

    datefield<"01/01/2000"

    Thanks for your help!

  5. #5
    VAR
    Real Name
    Martin W. Cole
    Join Date
    Apr 2000
    Location
    Terrell, Texas (near Dallas)
    Posts
    5,956

    Default Re: V10 Conditional Style - how to reference a empty date?

    dtos(datefield) > ""
    Cole Custom Programming - Terrell, Texas
    972 524 8714
    martin_w_cole@msn.com

    ____________________
    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

  6. #6
    Member
    Real Name
    Michael Scholin
    Join Date
    May 2007
    Location
    Madison, WI
    Posts
    321

    Default Re: V10 Conditional Style - how to reference a empty date?

    Martin,

    At first when I saw your suggestion I thought that was a clever way to achieve what I was trying to do so I tried it.

    Maybe because I am using SQL as the back end, but I got a script error when I tried. At least the datefield>"01/01/2000" does get the job done for what I am doing.

    Thanks again!

Similar Threads

  1. day on date style
    By netgeorger in forum Archived Wishlist
    Replies: 2
    Last Post: 05-26-2008, 01:01 PM
  2. Default a date field to NULL or EMPTY...
    By Hansolo in forum Alpha Five Version 6
    Replies: 44
    Last Post: 02-07-2005, 02:03 PM
  3. empty date field
    By dik_coleman in forum Alpha Five Version 6
    Replies: 2
    Last Post: 11-01-2004, 08:02 AM
  4. Date fields European style Question
    By René Stout in forum Web Application Server v6
    Replies: 8
    Last Post: 09-26-2004, 09:31 AM
  5. Empty Date Field Calculation
    By Tom Mills in forum Alpha Five Version 5
    Replies: 4
    Last Post: 10-04-2002, 02:36 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •