Query Help

gdanalakshmi

Registered User.
Local time
Today, 12:45
Joined
Nov 26, 2002
Messages
102
I am running a query and I use a criteria. But in my result, I am getting the records thta do not match the criteria. what could be possibley wrong?
here is my query..
SELECT qryRpt_FMoveExceedTimeFrame.HelpDeskWO, qryRpt_FMoveExceedTimeFrame.Days, qryRpt_FMoveExceedTimeFrame.DateCreated, qryRpt_FMoveExceedTimeFrame.DateClosed
FROM qryRpt_FMoveExceedTimeFrame
WHERE (((qryRpt_FMoveExceedTimeFrame.Days)>[Forms]![FrmMovesExceedTimeFrame]![TimeLimit]));


I get the criteria value from a text box in a form which has a default value of 8. When I set the criteris to be 20, I get records that are greater than 20 in timelimit ans alos records that are less than 10.

I donot know what is wrong?
 
I found the mistake..

The DateDiff("d",...) return the difference in terms of Integer.
When I try to use the Textbox value, it is in String. So I converted the String to Int using CInt(Texbox Value) and then compared with the result of DateDiff.
 

Users who are viewing this thread

Back
Top Bottom