Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Converting DateTime to Date Post Reply Post New Topic
Author Message
SaxmanTC
Newbie
Newbie
Avatar

Joined: 10 Sep 2010
Location: United States
Online Status: Offline
Posts: 7
Quote SaxmanTC Replybullet Topic: Converting DateTime to Date
     Posted: 10 Sep 2010 at 2:50am
I'm having some trouble getting a string field to convert to a date. Hopefully someone can help out.

My string is 2008-02-14 00:00:00 and I need to strip off the 00:00:00 from the field. I don't even care if it remains a string, but the time isn't needed and is getting in the way.

Any suggestions?

BTW - I'm pretty new to Crystal, so please place remarks in the easiest fashion for a hardware admin to figure out. My mind dosen't work like a DBA (yet) Tongue

Thanks,

Tom
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 10 Sep 2010 at 3:19am

left({table.datetimeField}, instr({table.datetimefield}, " ") - 1)

 
HTH
IP IP Logged
SaxmanTC
Newbie
Newbie
Avatar

Joined: 10 Sep 2010
Location: United States
Online Status: Offline
Posts: 7
Quote SaxmanTC Replybullet Posted: 10 Sep 2010 at 5:38am
Not too sure where to put this code, but I'll scratch around until I find it...

Thank you for the reply.

Tom
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 13 Sep 2010 at 3:25am
create a formula, put the code in the formula, place the formula where you want the Date field displayed.
 
HTH
IP IP Logged
SaxmanTC
Newbie
Newbie
Avatar

Joined: 10 Sep 2010
Location: United States
Online Status: Offline
Posts: 7
Quote SaxmanTC Replybullet Posted: 13 Sep 2010 at 3:33am
Yes! That did the trick very nicely! I got the report working this morning and all is well...
 
Thank you very much!
 
Tom
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum