Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Unix Timestamp Post Reply Post New Topic
Author Message
eskimo42
Newbie
Newbie


Joined: 14 Jan 2008
Location: United States
Online Status: Offline
Posts: 2
Quote eskimo42 Replybullet Topic: Unix Timestamp
     Posted: 14 Jan 2008 at 8:24am
I have an ecommerce DB which I am trying to report on using Crystal Reports 2008. Please bear with me, this is my first time using Crystal Reports. Here is my issue:

The order creation date field in the eCommerce DB is being pulled as a Unix Timestamp. After some research online I have found that this formula should help me convert the timestamps into a readable format:

DateAdd (”s”,{jos_vm_orders1.cdate}-18000, #1/1/1970#)

So I have created numerous formula fields, Formatting Formulas, Custom Functions, and all I can seem to come up with is this error:

The ) is missing.

I really hope someone can walk me through how exactly I can convert a DB field which appears in a report to, a readable time stamp with that formula I have above.

Thanks,

Evan
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 14 Jan 2008 at 11:24am
Well, as an initial question, have you created a formula with just the above text?  Because, that looks correct.  The one piece that bothers me is that your field name is "cdate," and that is a function in Crystal (well, and lots of other things).  But, since it is in the curly brackets, it shouldn't be an issue.


IP IP Logged
eskimo42
Newbie
Newbie


Joined: 14 Jan 2008
Location: United States
Online Status: Offline
Posts: 2
Quote eskimo42 Replybullet Posted: 14 Jan 2008 at 11:36am
I think I have fixed the formula.. Well possibly, because someone advised me on the crystal forum how to do that.

The only problem is, since I am new, and still learning. I am really trying to figure out how I would mask this database field using that formula. What kind of formula do I have to make, and how do i set that field to use that formula absolutely?

Any Help would be appreciated!

Thanks,

Evan


IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 15 Jan 2008 at 4:10am
Create the formula as above.

Anywhere in the report where you would normally reference the database field, simply reference the formula instead.  E.g., instead of putting {jos_vm_orders1.cdate} in a formula designed to tell if the order is late, simply put {@MyFormula} instead.  Similarly, you can add the formula field to the report, instead of the database field.


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