cancel
Showing results for 
Search instead for 
Did you mean: 

Add time to a Date field

Former Member
0 Kudos

Hi,

I have a problem where in my Database I have a date & time field. when i query this field in mysql, it looks like this

2009-05-22 11:17:52.000

year 2009

month may

date 22nd

time 11:17 (52.000 seconds)

I want to be able to add an hour to this field in Crystal Reports and output it on a report. So the output would look something like:

2009-05-22 12:17:52.000

How would I go about doing this.

I tried doing a ToText() + '2009-05-22 12:17:52.000' but it just appends it to the end of the rigonal date.

thanks

J

Sorry..I forgot to mention the DateField is a Date/Time field.

Edited by: James Knockler on May 22, 2009 12:21 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi!

Try writing a formula using the following line. It works with MS SQL, sorry, I don't know if it will help in MYSQL.

local datetimevar temp := dateadd("h",1,)

Regards,

David

Former Member
0 Kudos

thanks for that. worked a treat.