Query for date

okl

Board Regular
Joined
Jan 17, 2008
Messages
52
Office Version
  1. 365
Platform
  1. Windows
Hi there,

I have a table with a date field "ETB" in ddmmyyyy hh:mm:ss

How can i do a query to extract out the data that is 2 days ago for eg. 22/08/2015 23:59

I set auto schedule to run the query weekly on monday 06:00, but i do not want the latest data.


Thanks
 
Last edited:

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
'find those 2 days prior today
select * from table where [ETB] = dateadd("d",-2, Date())\

'find those 2 days prior given date
select * from table where [ETB] = dateadd("d",-2,"22/08/2015")
 
Upvote 0
'find those 2 days prior today
select * from table where [ETB] = dateadd("d",-2, Date())\

'find those 2 days prior given date
select * from table where [ETB] = dateadd("d",-2,"22/08/2015")

If i run the query on today 06:00, but i want it to be 22/08/2015 "23:59" not 06:00
 
Upvote 0

Forum statistics

Threads
1,221,847
Messages
6,162,380
Members
451,760
Latest member
samue Thon Ajaladin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top