Query with date into future

lcline

Registered User.
Local time
Today, 20:08
Joined
Oct 23, 2001
Messages
53
Thanks in advance!

I have a query where I am trying to filter out records using a date column and another column with an integer value.

What I trying to do is set the criteria for a date range and depending on the date colum + interger colum return the recordset.

This is statements I have tried.

SELECT PMS.Equipment, PMS.Task, PMS.Procedure, PMS.Assigned_Mechanic, PMS.Man_Hours, PMS.Frequency, PMS.[Freq Data] AS Expr1, PMS.Last_Completed, [PMS].[Last_Completed]+[Freq Data] AS Expr1, PMS.[Deferred?]
FROM PMS
WHERE ((([PMS].[Last_Completed]+[Freq Data]) Between [Enter Begin Date] And [Enter End Date])) OR (((PMS.[Deferred?])=Yes));

SELECT PMS.Equipment, PMS.Task, PMS.Procedure, PMS.Assigned_Mechanic, PMS.Man_Hours, PMS.Frequency, PMS.[Freq Data] AS Expr1, PMS.Last_Completed, [PMS].[Last_Completed]+[Freq Data] AS Expr1, PMS.[Deferred?]
FROM PMS
WHERE (((DateAdd("d",][Freq Data],[PMS].[Last_Completed) Between [Enter Begin Date] And [Enter End Date ])) OR (((PMS.[Deferred?])=Yes));

With the first I get back different results (none correct) with the way I entered the dates 10/30/04 -- 10/6/04 give something different than 10/31/2004 -- 10/06/2004. With the second it states the format is wrong

I tried formating the Expr1 expression as Shortdate with no luck.

Could someone help me with this?

Thanks,
Lee
 
I think that I stumbled onto something. it is not seeing the input of date paramaters as dates. I added text box to the form and formated them as short date and it seems to work.
again thanks,
lee
 

Users who are viewing this thread

Back
Top Bottom