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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Displaying the Year

Status
Not open for further replies.

seigs

IS-IT--Management
Nov 28, 2006
3
0
0
US
Hi everyone,

Running Crystal XI, MS SQL Server.

Having a strange problem. I am pulling a date field from a view that won't display correctly in Crystal. The year frequently (though not always) is displayed incorrectly. "2002" becomes "2020". Or sometimes the final digit is left off (i.e. "199" instead of "1994").

I've converted the field within the view to a datetime. It displays correctly when I open the view. Though when I pull it up to Crystal, Crystal does not recognize the field as a datetime. I've tried using CDate equation to convert it into a date. No luck - I still get truncated or wrong dates.

Anyone have any ideas? Thanks in advance.
 
Maybe you could try converting the field to a datetime in Crystal, and leave the field as its original data type in the view.
 
Try something like
Code:
ToText(Cdate({your.datestring}), "yyyy")


[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top