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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need more syntax help with my query

Status
Not open for further replies.

ruthcali

Programmer
Apr 27, 2000
470
US
i am using Access 97.

please help,
in my query, the following works:
TER: IIf ([s_ticket] Between [Forms]![frmRptTotals]![txtDate1] And [Forms]![frmRptTotals]![txtDate2],1,0)

but this doesn't:
TER: IIf (DateAdd("d",-32,[s_ticket]) Between [Forms]![frmRptTotals]![txtDate1] And [Forms]![frmRptTotals]![txtDate2],1,0).

Forms![frmRptTotals]![txtDate1] is in the form: 11/01/2000
and Forms![frmRptTotals]![txtDate2] is in the form: 11/30/2000.

i am stumped.
thanks,
ruth
 
ARe you sure that the Function DateAdd is actually returning something. I don't see anything wrong with any part shown. Try displaying what DateAdd returns before doing the IIf statement. Sorry I'm not more help.

Walt III
SAElukewl@netscape.net
 
Hi Walt,

Thanks for writing.
i figured it out. the problem was with my txtDate1 field.
(nothing you could have known about from my question.)

All i had to do was use the CDATE function. now it works. the sad thing is that i got burned on not using the CDATE function before. maybe this time i'll learn.

thanks again.

ruth.jonkman@wcom.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top