Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: [Resolved] Formula Issues Post Reply Post New Topic
Author Message
snufse
Newbie
Newbie


Joined: 19 Mar 2008
Location: United States
Online Status: Offline
Posts: 36
Quote snufse Replybullet Topic: [Resolved] Formula Issues
    Posted: 02 May 2012 at 10:26am
Using CR XI and have following formulas:
 
CStr({Transaction.TicketNumber})
 
the value is the table is 8482931 and is being rendered as 8.482.931.00 how can I get the value without decimals and periods?
 
 
 
CStr(CDate({Transaction.DateOut}),"MM/dd/yyyy HH:mm")
 
the value in the table is 2/6/12 6:49 am and I need to get the value 2/6/2012 6:49am
 
Thank you.


Edited by snufse - 03 May 2012 at 4:40am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 02 May 2012 at 11:56am
CStr({Transaction.TicketNumber},0,"")
 
CStr(CDate({Transaction.DateOut}),"M/d/yy H:mtt")


Edited by DBlank - 02 May 2012 at 12:00pm
IP IP Logged
snufse
Newbie
Newbie


Joined: 19 Mar 2008
Location: United States
Online Status: Offline
Posts: 36
Quote snufse Replybullet Posted: 03 May 2012 at 2:01am

I still have an issue with the date string conversion and not getting the time

CStr(CDate({Transaction.DateOut}),"MM/dd/yyyy HH:mm")
 
The DateOut is a datetime field in the table.
 
I get 02/06/2012 HH:mm and would like to see 02/06/2012 6:49am


Edited by snufse - 03 May 2012 at 2:29am
IP IP Logged
snufse
Newbie
Newbie


Joined: 19 Mar 2008
Location: United States
Online Status: Offline
Posts: 36
Quote snufse Replybullet Posted: 03 May 2012 at 3:35am
I changed the the line of code to look like this:
 
 CStr({Transaction.DateOut},"MM/dd/yyyy HH:mm")
 
and I am now getting 02/06/2012 06:49 which is good.
 
Last issue is:  how do I get am or pm associated with the time?
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 May 2012 at 3:38am
use tt on the end
although you can handle all of the formatting by right clicking on the original datetime field
select format field
datetime tab
pick the one you want or use customize


Edited by DBlank - 03 May 2012 at 4:42am
IP IP Logged
snufse
Newbie
Newbie


Joined: 19 Mar 2008
Location: United States
Online Status: Offline
Posts: 36
Quote snufse Replybullet Posted: 03 May 2012 at 4:40am
Smile
That worked, Thank you 
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.016 seconds.