Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

null dates

Status
Not open for further replies.

legendv

Technical User
Apr 10, 2002
32
US
in a query I want to show usage days by subtracting the end date from the beginingdate, however sometimes the ending date isn't complete, so I want to say something like if enddate is null then date() - beginingdate. Anyone know how to do that?
 
You almost have the right answer. Look at the IFF and the DateDiff statements. Should be able to do:

IFF (IsNull(EndDate), DateDiff("d", Date(), StartDate), DateDiff("d", EndDate(), StartDate)) Terry
**************************
* General Disclaimor - Please read *
**************************
Please make sure your post is in the CORRECT forum, has a descriptive title, gives as much detail to the problem as possible, and has examples of expected results. This will enable me and others to help you faster...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top