Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
I have a simple app where i want to count number of tickets for previous week.
However it doesn't work. Previous week is not correct and the count of tickets is for the whole period, not for prev week.
Year(Today())&'-'&Week(today()-7,'WW') as PreviosWeek
(Count( wor_ticket_ID))
Hi,
You probably want either an IF statement or a piece of set analysis on your count that either refers to the date that is associated with each ticket or to a calendar, depending on how complicated your previous week is to calculate.
What is the date field called?
Cheers,
Chris.
Hi!
Previous week is calculated as above:
Year(Today())&'-'&Week(today()-7,'WW') as PreviosWeek
Hi,
I am not sure how that would handle first week of the year. When you say previous week, do you mean the last 7 days, or, the last set of seven days forming a week (so on a Monday to Sunday basis previous week is 15th-21st inclusive given today is 22nd, and would remain as that until next monday when this week becomes previous week).
But more fundamentally how do you know that a ticket is to be counted in the previous week? So I imagine it has a field something like 'TicketDate' or 'OrderDate' (or just 'Date') which you need to work out is in the previous week to then count wor_ticket_ID for those.
Cheers,
Chris.