Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Concatenat string with formula Post Reply Post New Topic
Author Message
Hossam
Newbie
Newbie
Avatar

Joined: 31 Mar 2009
Location: Egypt
Online Status: Offline
Posts: 23
Quote Hossam Replybullet Topic: Concatenat string with formula
     Posted: 31 Mar 2009 at 5:10am

Hi all,

 

I have a formula

DateDiff ("h" ,{INCIDENTSM1.OPEN_TIME} ,{INCIDENTSM1.CLOSE_TIME} )

 

It is working fine and the result as following :

01:02

 

What I want to do how can add hours "h" and minutes "m" string to this formula to see result as following

 

01h 02m 

 

Any help I will be appreciated

 

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 31 Mar 2009 at 6:43am
ToText(DateDiff ("h" ,{INCIDENTSM1.OPEN_TIME} ,{INCIDENTSM1.CLOSE_TIME} ), "hh'h' mm'm')
IP IP Logged
Hossam
Newbie
Newbie
Avatar

Joined: 31 Mar 2009
Location: Egypt
Online Status: Offline
Posts: 23
Quote Hossam Replybullet Posted: 31 Mar 2009 at 7:20am
thanks for the quick response,
 
when verify on syntax i get
 
the matching" for this string is missing
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 31 Mar 2009 at 3:43pm

try:

ToText(DateDiff ("h" ,{INCIDENTSM1.OPEN_TIME} ,{INCIDENTSM1.CLOSE_TIME} ), "hh'h' mm'm'")
IP IP Logged
Hossam
Newbie
Newbie
Avatar

Joined: 31 Mar 2009
Location: Egypt
Online Status: Offline
Posts: 23
Quote Hossam Replybullet Posted: 01 Apr 2009 at 1:49am
error changed to be
 
Bad Number Format string
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 01 Apr 2009 at 6:08am
OK, datediff returns a number, not a datetime, so how about trying:
ToText({INCIDENTSM1.CLOSE_TIME} - {INCIDENTSM1.OPEN_TIME}, "hh'h' mm'm'")
IP IP Logged
Hossam
Newbie
Newbie
Avatar

Joined: 31 Mar 2009
Location: Egypt
Online Status: Offline
Posts: 23
Quote Hossam Replybullet Posted: 01 Apr 2009 at 6:51am
the same error
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