Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateTime Parameter and Display in Report

Status
Not open for further replies.
Jun 23, 2008
55
GB
I have a report that uses Parameters DateFrom and DateTo and picks up records where the field DateStart is between these two.

The DateStart is a DateTime field and I've selected the DataType in the Parameter as such.

The report itself shows the DateStart values for each record, I don't want to show the time so I have entered the following in the expression for the textbox:

=Format(Fields!DateStart.Value,"dd/MM/yyyy")

My problem is that this seems to prevent the report from running, I get the following error message:

Argument not specified for parameter 'StringDate' of 'Public Function DateValue(StringDate As String) As Date

It runs ok without formatting the display of DateStart in the report but this shows the time which I don't want.

How can I use the parameter AND display the date in the report as date only please?

Many Thanks
Annie
 
Don't enter it as the expression for the textbox. Leave the field reference as it is (Fields!DateStart.Value) and amend the format property of the textbox to dd/MM/yyyy



Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Thank you so much Geoff, I hadn't even found that Format facility! It's gonna take time I think making the switch from Crystal but thank god for forums :eek:)

Kind Regards
Annie
 
No worries - basically everything has a bunch of properties - most of which can be set to the value of an expression so you can do stuff like:

=iif(Fields!FieldName.Value < 0 ,"Red","Black")

in the font colour property

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top