|
-
Dec 14th, 2005, 01:19 PM
#1
Thread Starter
Hyperactive Member
Get day name from date selection parameter
I have a date selection parameter where I need to get the day name to put on the report.
My string looks like this: "Car Counts between the dates of " + ToText({?dtDateBegin}) + " and " + ToText({?dtEndDate})
Which shows on the report like this: Car Counts between the dates of 10/1/2005 and 10/31/2005
What I am trying to do is to get it to say: Car Counts between the dates of 10/1/2005 (Saturday) and 10/31/2005 (Monday).
I thought something like this would work
"Car Counts between the dates of " + ToText({?dtDateBegin}) + " " + WeekdayName({?dtDateBegin}) + " and " + ToText({?dtEndDate}) + " " + WeekdayName({?dtEndDate})
but that wants a number at the ?dtDateBegin and end parameters. Any ideas? I just looked a little deeper into the WeekdayName and that is looking for a value of 1 -7. I want to get a day name when someone selects 10/1/05 from a date selector.
-
Dec 14th, 2005, 01:24 PM
#2
Re: Get day name from date selection parameter
I've used this before to get the name of the day:
VB Code:
Option Explicit
Private Sub Form_Load()
MsgBox WeekdayName(Weekday(Now))
End Sub
-
Dec 14th, 2005, 01:42 PM
#3
Re: Get day name from date selection parameter
You are probably using Crystal Syntax so the equivalent would be
+ WeekdayName(DayOfWeek({?dtEndDate}))
-
Dec 14th, 2005, 02:25 PM
#4
Thread Starter
Hyperactive Member
Re: Get day name from date selection parameter
Thank you both. I am using Crystal Syntax so the second solution worked perfectly.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|