
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Date Calculation
Morning,
I need to create a weeks figure, based on the time that an item has been on offer for sale, or TOO (Time on Offer). For example, I have an item which launched on 01/07/2014 today's date is 16/01/2018 so the TOO would be 209 Weeks. The data being provided by the SQL table is DATETIME, so i'm also not sure if I need to cater for this.
Any help is appreciated.
Regards
David
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi David,
You should be able to write something like this in your load script:
(Today() - [YourDateField]) / 7 AS TOO
You can also either Ceil() or Floor() the result depending on what you want.
-Teemu

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, that should be 185 Weeks, not 209!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi David,
You should be able to write something like this in your load script:
(Today() - [YourDateField]) / 7 AS TOO
You can also either Ceil() or Floor() the result depending on what you want.
-Teemu
