Joined: 24 Mar 2011
Location: United States
Online Status: Offline
Posts: 8
Topic: need help with date(s) Posted: 24 Mar 2011 at 8:22am
This is a little lengthy..please bear with me.
We have a date-time field that doesn't necessarily have the hour:min:sec portions populated. In those cases, I have to use the a number field that contains only HHMM info.
I need to use either ...
- the date-time field in its entirety OR - the date portion of the date-time field concatenated with the HHMM field
I've been wrestling lots of date functions to create a complete date-time field, but, so far I haven't had any luck. HELP!
Joined: 24 Mar 2011
Location: United States
Online Status: Offline
Posts: 8
Posted: 26 Mar 2011 at 7:43pm
I have continued to search the web for an answer. Please help ..
I haven't used VB date functions in a while; and I'm relatively new to the CrystalReports environment.
I need to create a complete date-time field. If necessary, I can extract the year, month, and day portions from my date-time field; and, I can extract the hour and minute portions from my HHMM field.
I need to know what function should be used to create a complete date-time field. I've tried CDate, but apparently I'm not formatting everything correctly. Thanks in advance for any suggestions or advice.
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 28 Mar 2011 at 3:39am
sorry was out for a bit..
try
if time(datetime_field)<>time(00,00,00) then datetime_field else datefield + time(tonumber(if {timefield}>=1000 then left(totext({timefield},0,''),2) else left(totext({timefield},0,''),1)), tonumber(right(totext({timefield},0,''),2)), 00)
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