DateDiff question

jasn_78

Registered User.
Local time
Today, 20:18
Joined
Aug 1, 2001
Messages
214
hey guys i have a query where i want to return all values with a difference greater than a value entered in the user.

Now DateDiff is working fine for this but the only problem i am having is if i set it to > FormTextBox nothing is being selected but if i actually put in a number e.g > 10 in the where clause it works fine. Any ideas?
 
Sorry guys still having problems have it working that i can go for greater than the text box but i only want to do that if check box is ticked otherwise return all records.

Below is my sql can anyone help please

SELECT INVHTBL.INVH_ORDER_NO, Abs(DateDiff("d",[INVHTBL]![INVH_LAST_UPD_DATE],[INVHTBL]![INVH_UPD_TIMESTAMP])) AS Days
FROM INVHTBL
WHERE (((Abs(DateDiff("d",[INVHTBL]![INVH_LAST_UPD_DATE],[INVHTBL]![INVH_UPD_TIMESTAMP])))=IIf([Forms]![frmINVOICES]![chkYESNO]=-1,(Abs(DateDiff("d",[INVHTBL]![INVH_LAST_UPD_DATE],[INVHTBL]![INVH_UPD_TIMESTAMP])))>CInt([Forms]![frmINVOICES]![txtDAYS]),(Abs(DateDiff("d",[INVHTBL]![INVH_LAST_UPD_DATE],[INVHTBL]![INVH_UPD_TIMESTAMP])))>0)))
GROUP BY INVHTBL.INVH_ORDER_NO, Abs(DateDiff("d",[INVHTBL]![INVH_LAST_UPD_DATE],[INVHTBL]![INVH_UPD_TIMESTAMP]));
 
Try using something like:
Where (Datediff > DaysEntered and Tickbox = true)
or (tickbox is false)
 

Users who are viewing this thread

Back
Top Bottom