Frage

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

War es hilfreich?

Lösung

try this..

"From : " & ToText(Minimum({?date}), "dd/MM/yyyy") & 
" To :" & ToText(Maximum({?date}), "dd/MM/yyyy")

If the datetime is in field (not a formula) then you can format it:

Right click on the field -> Format Editor Date and Time tab Select date/time formatting you desire (or click customize) If the datetime is in a formula:

ToText({MyDate}, "dd/MMM/yyyy")
//Displays 31/Jan/2010

or

ToText({MyDate}, "dd/MM/yyyy")
//Displays 31/01/2010

or

ToText({MyDate}, "dd/MM/yy")
//Displays 31/01/10

etc...

Andere Tipps

use the string conversion to date

CDate ("17/02/2014") or CDate(<<Database Field>>)

try this

if not "cdate" error "bad date format for string" 

local stringvar input := {table.field};
date(val(input[1 to 4]),val(input[5 to 6]),val(input[7 to 8]))

I found this successful!

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top