CoachBarker
New member
- Local time
- Today, 14:00
- Joined
- Mar 28, 2009
- Messages
- 5
I have a field coming into a report from SQL Server 2005 that is a date in a string format. I am using an IIF statement to format the string for the report so when it exports to excel it still reads in it's proper format. This is the IIF:
=IIF (Len(Fields!pickup_dt.Value) = 8,Cstr(LEFT(Fields!pickup_dt.Value,4))+ "/" + CStr(SUBSTRING(Fields!pickup_dt.Value,5,2)) + "/" + Cstr(Fields!pickup_dt.Value,7,2))
And this is the error that I get:
The Format expression for the textbox ‘pickup_dt’ contains an error: [BC30451] Name 'SUBSTRING' is not declared.
in the db the format is yyyyMMdd, it will always have 8 characters so I just need to add in the slashes yyyy/MM/dd.
Any Suggestions?
Thanks
CoachBarker
=IIF (Len(Fields!pickup_dt.Value) = 8,Cstr(LEFT(Fields!pickup_dt.Value,4))+ "/" + CStr(SUBSTRING(Fields!pickup_dt.Value,5,2)) + "/" + Cstr(Fields!pickup_dt.Value,7,2))
And this is the error that I get:
The Format expression for the textbox ‘pickup_dt’ contains an error: [BC30451] Name 'SUBSTRING' is not declared.
in the db the format is yyyyMMdd, it will always have 8 characters so I just need to add in the slashes yyyy/MM/dd.
Any Suggestions?
Thanks
CoachBarker