I have two dates in my code..date 1 and date2.
I want to calculate the number of sundays between the above dates,
I am using IBM DB2.
Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m not sure of what you mean in your code.
If you have values you’re trying to lookup from a database the most sustainable way would be to create a function that you could call. If this is not doable as a result of your permissions / etc. you can take a look at the below SQL:
*Please note: The
DAYOFWEEKcall will return a numberrange of 1-7where 1 is Sunday and 7 is Saturday.