on 02-21-2014 9:10 AM
Hi,
I created an asp application with crystal report. In that dates are stored as varchar in sql, and pass that value as string from asp to crystal report. Here that string format is converted to date by using Datevalue function. But i try to execute the report it shows bad date format string error. date format stored in sql is 'dd/mm/yyyy'
How to convert the string to date value in crystal report
If your date string is always dd/mm/yyyy, try this:
If not IsNull({date string field}) and {date string field} <> "" then
Date(ToNumber(Right({date string field}, 4), ToNumber(Mid({date string field}, 4, 2)), ToNumber(Left({date string field}, 2)))
This will return null if there is no value in the string and a date if there is.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.