Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Universe Design Question (regarding Crystal Functions)

Status
Not open for further replies.

gonzo27

Technical User
Mar 6, 2008
10
US
Hello,

I need to know the Universe Designer syntax for the following 2 Crystal Functions that I created to translate Mumps Date and Mumps Time.


Function (StringVar MTIME)
TimeSerial(0,0,tonumber(MTIME))

This takes a numeric and translates it to a time...for example "70" gets translated to 12:01:10 AM (the MTIME keeps the seconds since midnight)


Function (StringVar MDATE)
DateAdd("d", +tonumber(MDATE), #Jan 01, 1841#)

This takes the numeric value and assigns a date since the MDATE is a count of the days that have gone by since 1/1/1841

I do not know the Oracle Syntax so please point me in the right direction...

Thank you,
G
 
Oracle allows you to simply add integers to a date like:

Code:
sysdate + 1  = 'tomorrow'

So the startdate combined with the mdate should yield the proper date

For time this may just be a bit more complicated.

Look into the 'Mod' function for breaking down the integer to a time like format..

Ties Blom

 
Thank you so much...

I'm not sure if I didn't explain it correctly but the MDATE field keeps a number representing the days that have gone by since 1/1/1841....so won't me adding this number to sysdate give me a future number? or am I supposed to use MDATE (it's a number though) in place of sysdate, I don't know why they called it "MDATE" when it stores a number not a date..

Appreciate the help!
J
 
It was just an example. Adding the integer value to 1/1/1841 (as date) should yield the proper date..

Ties Blom

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top