I'm creating reports off of a pre-existing database (I didn't create the database). I need to generate a report, and part of it will have this functionality:
If there is no data entered in for two fields, or if there is data entered for two fields, then display. Otherwise, don't. Possible combos:
CombinedDate1 CombinedDate2
5/5/2006 10/10/2006 Show this!
<nothing> <nothing> Show this!
5/5/2006 <nothing> Don't show this!
Now, the CombinedDate values are created from two seperate fields: one with the date, teh other with the time. I'm attempting to use the following in my SQL:
The problem is that I don't get any records back where both fields are empty and have no value! I've also tried this:
with no luck either.
The date1/2 and time1/2 are all date/time fields in the Access database. Am I missing something here?! If I have nothing and add it to nothing and compare the string value (="") that should be enough...or at the least, it should equal null (=null)...but neither are working?!
Help!
DL
If there is no data entered in for two fields, or if there is data entered for two fields, then display. Otherwise, don't. Possible combos:
CombinedDate1 CombinedDate2
5/5/2006 10/10/2006 Show this!
<nothing> <nothing> Show this!
5/5/2006 <nothing> Don't show this!
Now, the CombinedDate values are created from two seperate fields: one with the date, teh other with the time. I'm attempting to use the following in my SQL:
Code:
AND
(
([date1]+[time1]<>"" AND [date2]+[time2]<>"")
OR
([date1]+[time1]=null AND [date2]+[time2]=null)
)
The problem is that I don't get any records back where both fields are empty and have no value! I've also tried this:
Code:
AND
(
([date1]+[time1]<>"" AND [date2]+[time2]<>"")
OR
([date1]+[time1]="" AND [date2]+[time2]="")
)
with no luck either.
The date1/2 and time1/2 are all date/time fields in the Access database. Am I missing something here?! If I have nothing and add it to nothing and compare the string value (="") that should be enough...or at the least, it should equal null (=null)...but neither are working?!
Help!
DL