Page 1 of 1

Convert to day of week using date field, like MOn, Tue , Wed

Posted: Tue Apr 10, 2007 3:26 pm
by srao
Convert to day of week using date field, like MOn, Tue , Wed

converting date formate -2007-01-01 00:00:00.000 to--- day of week

how to solve this problem in Parallal jobs.

Thank yo

Posted: Tue Apr 10, 2007 4:11 pm
by DSguru2B
Set the default for timestamps as %yyyy-%mmm-%dd %hh:%nn:%ss.

Posted: Tue Apr 10, 2007 5:18 pm
by chulett
You're not answering the question asked. I can't or I would.

From that timestamp format, how does one get the 'Day of the Week' (Mon,Tue,Wed,etc) for that particular date?

Posted: Tue Apr 10, 2007 7:06 pm
by DSguru2B
:oops: I jumped ahead of myself.
Change the default timestamp as I advised. Use the TimestampToString() function to change to string and then do

Code: Select all

FIELD(date, "-", 2, 1)
This will give you the day :)

Posted: Tue Apr 10, 2007 7:09 pm
by ray.wurlod
WeekdayFromDate() will return the weekday number (based on your business rules for the start of the week). You first need to extract the date portion from the timestamp. Once you have the weekday number you can use Field() to perform a lookup from a string constant containing a delimited string of the weekday names.