Query !! help

  • Thread starter Thread starter NAL
  • Start date Start date
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
 
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.
 
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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top