Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am trying to split Year, Quarter, Month, Week and Day from my Date column
I am incorporating Indian Financial Calender 2014-15 i.e First Month is April 14 and last Month is March 15
I need your assistance to get the first week of the Financial Year i.e. the first week of Apri l14 should be the first week of the year, I am using Weekname function but am unable to get the result
Attached is the Data and QVW.
Thanks in advance.
Hi.
According to QV help:
"If you want to work with weeks not starting midnight between Sunday and Monday,
indicate an offset in days in weekoffset."
So, you have to calculate the offset in days:
WeekName([Appointment_Date],0, DayNumberOfYear(makedate(year([Appointment_Date]), 4, 1)))
See attached qvw for a calendar creation script that also generates the week numbers.
It depends on the query on your DB.
For example in MySql :
Week(Data,3) means the first week of the year is 1 and the first day of week is Monday.
The Default as Week(Data) is the first weeh of day 1 and the first day of week Sunday.
Regards,
Antonio
Hi White Line,
Your code worked, however for the first week of the Year i.e 1st week of April 2014 the days getting highlighted are from 1st Apr 2014 to 07th Apr 2014.
Actually the 1st week of the year 2014, should start from 30th March 2014(Sunday) and end at 05th April 2014 (Saturday)
WeekName([Appointment_Date],0, DayNumberOfYear(makedate(year([Appointment_Date]), 3, 30)))
There is no magic. Read the QV help.