query to return previous date

Erick

Active Member
Joined
Feb 26, 2003
Messages
362
I have a table with a date field (dates when file had been backed up). The backing up of files doesn't happen everyday so there will be gaps in the date sequence.

what I need is to write a query to return for every entry (row), the previous back up date.

any idea how this can be done?
 
Erick

I think gaj104 has posted the SQL to do it in one query rather than my idea of using 2.:)

Mind you I'm still not 100% sure what you are looking for.

Your data seems to be producing the previous date for every entry.

Perhaps I was wrong but I thought you wanted the previous date for each machine, ie one date per machine.
 
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Erick

I think gaj104 has posted the SQL to do it in one query rather than my idea of using 2.:)

Mind you I'm still not 100% sure what you are looking for.

Your data seems to be producing the previous date for every entry.

Perhaps I was wrong but I thought you wanted the previous date for each machine, ie one date per machine.

Hello Norie, I haven't actually tried gaj104's sql but you are right. I need the previous date for each machine. If you look at the sample excel table i posted, the date for the 16th returns the 14th (not 15th) because this is the previous date for MC1.
 
Upvote 0

Forum statistics

Threads
1,215,352
Messages
6,124,455
Members
449,161
Latest member
NHOJ

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