on 09-21-2010 1:54 PM
Is there a function in Crystal that tells you the day of the week that a date is???
Yes
Dayofweek(date) //will give you the number of the day of the week with 1 being Sunday
Weekdayname(Dayofweek(date)) //will give you the name of the day
for other date/time functions, look under functions for date and time in the formula workshop
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes there is... One of which is actually called DayOfWeek. You can also use the DatePart function as well. Both will return an integer value ranging from 1 - 7.
DayOfWeek({TableName.DateField})
-or-
DatePart("w", {TableName.DateField})
If you want to get the actual name of the week you can use a formula like this...
SELECT DayOfWeek(CurrentDate)
CASE 1 : "Sunday"
CASE 2 : "Monday"
CASE 3 : "Tuesday"
CASE 4 : "Wednesday"
CASE 5 : "Thursday"
CASE 6 : "Friday"
CASE 7 : "Saturday"
;
HTH,
Jason
-
Interesting Deb... I've never used WeekDayName.
Edited by: Jason Long on Sep 21, 2010 8:45 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.