Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I currently have a field in my table called [Effective Date].
I would like to add a new field called [Effective Day], where:
2011/04/11 = Monday
2011/04/12 = Tuesday, etc.
This way I can break my marketing report down to specific days of the week, as opposed to just dates.
My scripts currently contains this:
DATE(DATE#( [Effective Date], 'DD-MMM-YY')) as [Effective Date],
Thanks,
Gerhard
Muncho - I guess you are refering to the load script...
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
If this is right, then you can use this function
=Weekday(Now()) to return today's day
You will see the result as Thu
However if you change the assignment of DayNames variable in Load Script. Something like this...
SET DayNames='Monday;Tue;Wed;Thursday;Fri;Sat;Sun';
=Weekday(Now()) will return Thursday instead Thu.
I hope this makes sense to you. We are assigning the format with the SET Keyword in the load script.
Cheers!
you have to use WEEKDAY() function.
Regards, tresesco
Hi Tresesco,
Could you please explain to me how to incorporate it into my script, using the part of my script I posted above?. Every function or expression I'm using in QV I am using for the first time.
Very much appreciated,
G
Hello Im also new in QV.
in QV help it says:
weekday( date )
Week day. Returns an integer between 0-6.
Example:
weekday( '1971-10-30' ) returns 5.
I think after that you can use mapping load to give week names.
hi
weekday() function is the best solution..create a new field weekday(date) as day_name
Regard
Please use this one in your load script.
WeekDay(DATE(DATE#( [Effective Date], 'DD-MMM-YY'))) as [Effective Week Day]
Well i tried to use $(DayNames) to give week names but i cant ^^. Someone pls tell me how to use this.
Muncho - I guess you are refering to the load script...
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
If this is right, then you can use this function
=Weekday(Now()) to return today's day
You will see the result as Thu
However if you change the assignment of DayNames variable in Load Script. Something like this...
SET DayNames='Monday;Tue;Wed;Thursday;Fri;Sat;Sun';
=Weekday(Now()) will return Thursday instead Thu.
I hope this makes sense to you. We are assigning the format with the SET Keyword in the load script.
Cheers!
Well Weekday() will return integer right? 0 to 6. And i tried to turn this numbers to week names.
Or this weekday() will return week names?
Hi
If you have
Set LongDayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';
in the script
then
=date(today(),'WWWW')
is Thursday
Regards
Anders