×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Converting STRING (date as string) to a DATE value

Converting STRING (date as string) to a DATE value

Converting STRING (date as string) to a DATE value

(OP)
Am using a database which allocates time buckets as STRING values. Would like to somehow convert the values in this field to date values so i can then group by time in what ever interval i want using the group expert. The database (which I cant control) records info in 15 minute intervals. I would like to create a report in 1 hour intervals. It seems easy to convert a date to a string but much more difficult to convert a string to a date. Can anyone help?

RE: Converting STRING (date as string) to a DATE value

Depending on your version of Crystal Reports, you can use the DateTimeValue() function.  The online help has the syntax details.

Malcolm

RE: Converting STRING (date as string) to a DATE value

(OP)
We use crystal reports 6 which evidently doesnt have this function. What other options might exist? Thanks!

RE: Converting STRING (date as string) to a DATE value

What does a sample time string look like? ie, how is it stored?

Ken Hamady
http://www.kenhamady.com/
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)

RE: Converting STRING (date as string) to a DATE value

(OP)
stored as 22 character string:

example:

1996/12/08 23:59:00:00

RE: Converting STRING (date as string) to a DATE value

Look in your additional functions for a function called DTSToDateTime().  This will work with your string if you have it.

Ken Hamady
http://www.kenhamady.com/
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close