Query !! help

N

NAL

Hi , can you help me to make a query that shows only the date of a stock(Date
of Last Stock Check)
that been from 40 to 59 days

I really apreciate your help

thanks
 
P

Pinchas Tishyn

SELECT Abs(DateDiff("d",Date(),[field_LastStockCheck])) AS Date_Difference
FROM table_name
WHERE (((Abs(DateDiff("d",Date(),[field_LastStockCheck])))>=40 And
(Abs(DateDiff("d",Date(),[field_LastStockCheck])))<=59));

Notes: *
table_name = name of your table
field_LastStockCheck = name of the field where Last Stock Check date is
stored (must be of date type)
Datediff("d", date1, date2, .. ) = function that returns number of days
between date1 and date2. See help for more description.
ABS = returns absolute value.
 
N

NAL

Thank you so much,, it is working prefect :)

Pinchas said:
SELECT Abs(DateDiff("d",Date(),[field_LastStockCheck])) AS Date_Difference
FROM table_name
WHERE (((Abs(DateDiff("d",Date(),[field_LastStockCheck])))>=40 And
(Abs(DateDiff("d",Date(),[field_LastStockCheck])))<=59));

Notes: *
table_name = name of your table
field_LastStockCheck = name of the field where Last Stock Check date is
stored (must be of date type)
Datediff("d", date1, date2, .. ) = function that returns number of days
between date1 and date2. See help for more description.
ABS = returns absolute value.
Hi , can you help me to make a query that shows only the date of a stock(Date
of Last Stock Check)
[quoted text clipped - 3 lines]
 
Top