The forum will be unavailable for maintenance at some point from Friday, April 13 at 19:00 EDT until Sunday, April 15 at 23:59 EDT. Downtime will be minimized but the exact timing is unknown.

I am trying to get all the applications which was updated before 5 business day

I am able to to get all the applications by using the following where clause calculation.

Also, I would like to display the number of day it was last updated.

FROM Application A,

((Dayofyear(CURRENT_DATE) - Dayofyear(cast (A.LAST_UPDATE_TIMESTAMP as DATE))) + 1) - ((Week(CURRENT_DATE) - Week(cast (LAST_UPDATE_TIMESTAMP as DATE))) * 2) - (case when DAYOFWEEK(CURRENT_DATE) > 6 then 1 else 0 end) - (case when DAYOFWEEK(cast (LAST_UPDATE_TIMESTAMP as DATE)) < 2 then 1 else 0 end) >5

asked 04 Mar '14, 11:32

gag's gravatar image

accept rate: 0%


This forum is about SAP SQL Anywhere not MySQL - you will probably do better on Stack Overflow or a dedicated MySQL forum.

(05 Mar '14, 05:37) Justin Willey
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 04 Mar '14, 11:32

question was seen: 7,975 times

last updated: 05 Mar '14, 05:37