Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Please Explain this Post Reply Post New Topic
Author Message
namitanamburi
Newbie
Newbie


Joined: 26 Mar 2009
Online Status: Offline
Posts: 39
Quote namitanamburi Replybullet Topic: Please Explain this
     Posted: 19 Aug 2009 at 11:09am
if {?Date}="mm/dd/yyyy" then
   True
else
    Date({TABLE.MN_DT_TM}) = Date(ToNumber(Right({?Date},4)), ToNumber(Left({?Date},2)),    
        ToNumber(Mid({?Date},4,2)))


i UNDERSTAND THE IF CONDITION BUT CAN YOU EXPLAIN ELSE.


tHANKS
nAMMU
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Aug 2009 at 1:55pm

Takes a string of 8 characters (e.g."12012008") and converts it into a date format of DATE(yyyy,mm,dd) (e.g. Date(2008,12,01)

IP IP Logged
namitanamburi
Newbie
Newbie


Joined: 26 Mar 2009
Online Status: Offline
Posts: 39
Quote namitanamburi Replybullet Posted: 24 Aug 2009 at 8:56am
Thanks for the reply .


What does the last 4,2 in the formula represent.

It picks the mid value which is date and converts into number, I hope this is what it does, but what does the 4, 2 represent ?


Thanks
Nammu
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Aug 2009 at 9:03am
MID(value,4,2)
starts on the 4th character of the value field and uses the length of 2
e.g.

Mid("abcdef", 4, 2)

Returns "de".

 
MID (X,y,z)
x is the field or value to be used
y is the start point
z is the length
 


Edited by DBlank - 24 Aug 2009 at 9:05am
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