Calculating day in a week

Hi,
 I need to develop a report where it should retrieve only monday's transactions from the database and it should be scheduled to run every monday at 8. So can anyone please let me know the synatx I need to used in order to get the monday's data. and the column being use  for that in the databse is status date.

For example:
Status date: 2010-03-29 07:25:01.000 (this is how it is stored in databse)

Thanks,
ReportAnalystAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
SNeupaneConnect With a Mentor Commented:
All you have to do is below:
Create a filter in the query with following syntax:
_day_of_week ([Status Date],1) = 1


Change the [Status Date] column to whatever your date column is and you'll get data for Monday's only.
0
 
n2fcCommented:
1) Algorithm for day-of-week calc here:
http://en.wikipedia.org/wiki/Calculating_the_day_of_the_week

2) Just plug in the date(s) retrieved from db call and if not a Monday as verified by the algorithm, get next older record...

3) Scheduling on every Monday can be done with chron or Task Scheduler (depending on platform of server)
0
 
ReportAnalystAuthor Commented:
Hi,
 Thanks for the reply, but I am looking for a syntax to be used in cognos 8.4 report studi
0
 
SNeupaneCommented:
It is tested in Cognos 8.4
0
All Courses

From novice to tech pro — start learning today.