glennturner1
asked on
Change SSRS date to UK date format
Hi,
I have read a number of the other questions regarding this topic but I cant work out how to do what I need.
I am new to SSRS reporting, using Microsoft Visual Studio and have inherited a report that includes the following to display a date:
=FormatDateTime(First(Fiel ds!OrderDa te.Value, "OrderHed"),2)
The date is produced in the following format:
Friday, April 07, 2014.
Under properties the number format is dd/MM/yyyy however I cant get the date to appear how I would like which would be the UK date 07/04/2014
Could anybody tell me the settings I need to change to achieve that please.
If I have left out any necessary information please say.
Thank you
I have read a number of the other questions regarding this topic but I cant work out how to do what I need.
I am new to SSRS reporting, using Microsoft Visual Studio and have inherited a report that includes the following to display a date:
=FormatDateTime(First(Fiel
The date is produced in the following format:
Friday, April 07, 2014.
Under properties the number format is dd/MM/yyyy however I cant get the date to appear how I would like which would be the UK date 07/04/2014
Could anybody tell me the settings I need to change to achieve that please.
If I have left out any necessary information please say.
Thank you
ASKER
I just discovered in your link that the 2 in the SQL query means ANSI date, so I changed it to a 3 for UK date, but it just produced 12:00:00 AM instead!
I have found an order date in another report that looks like this and produces the type of date I want ie. 07/04/14:
=iif(isnothing(Fields!Orde rDate.Valu e), "", FormatDateTime(Fields!Orde rDate.Valu e, 2))
Can I modify this one somehow so that it will work in the first report?
I have found an order date in another report that looks like this and produces the type of date I want ie. 07/04/14:
=iif(isnothing(Fields!Orde
Can I modify this one somehow so that it will work in the first report?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi,
The expression you used above just produces the result on the report "dd/MM/yyyy"
Sorry, I am new to this, am I missing something I should have put in in place of "dd/MM/yyyy" ?
The expression you used above just produces the result on the report "dd/MM/yyyy"
Sorry, I am new to this, am I missing something I should have put in in place of "dd/MM/yyyy" ?
Erm, that's weird? Where did you put that expression? It should be put as content of the textbox, so not in the Format property... Is that what you did?
ASKER
I created a textbox and the expression is within it.
What happens if you use the following expression?
=Format(Now(), "dd/MM/yyyy")
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The CDate function converts your OrderDate field to the date type so it confirms what I stated in comment #a39988272.
Disregarding the conversion, the final solution you've mentioned is using the method first described in comment #a39986097.
So a possible closure is your last comment as accepted with the two comments above as assisted...
Disregarding the conversion, the final solution you've mentioned is using the method first described in comment #a39986097.
So a possible closure is your last comment as accepted with the two comments above as assisted...
ASKER
OK, could you tell me how to mark two comments as accepted andhow I should plit the points please.
ASKER
Advice provided between two responses did lead to the correct answer, thank you.
select convert(DATETIME, getdate(), 103)
More info on the sql formats:
http://www.blackwasp.co.uk/SQLDateTimeFormats.aspx