Home
Crystal Reports Training
Crystal Reports XI
Crystal Reports .NET
Crystal Reports Forum
News
Tech Support
Active Topics
Memberlist
Search
Help
Register
Login
Technical Questions
Crystal Reports Forum
:
Crystal Reports 9 through 2022
:
Technical Questions
Topic: Convert string to date
Author
Message
docmig
Newbie
Joined: 18 Mar 2012
Location: United States
Online Status: Offline
Posts: 3
Topic: Convert string to date
Posted: 18 Mar 2012 at 5:45pm
I have a string in the format mm/dd/yy that I need to convert to a date in CR. The years are all 2000 or greater. How do I do this?
IP Logged
rkrowland
Senior Member
Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Posted: 19 Mar 2012 at 3:13am
date("20" & right({table.field},2),left({table.field},2),mid({table.field},4,2))
Regards,
Ryan.
Edited by rkrowland - 19 Mar 2012 at 3:14am
IP Logged
docmig
Newbie
Joined: 18 Mar 2012
Location: United States
Online Status: Offline
Posts: 3
Posted: 20 Mar 2012 at 6:05am
Thanks but when putting in the formula I get the following error when checking it:
Too many arguments have been given to this function
Any ideas?
Crystal Reports 10
IP Logged
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 20 Mar 2012 at 7:12am
date(table.field)
should also work
Edited by DBlank - 20 Mar 2012 at 7:13am
IP Logged
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 20 Mar 2012 at 7:40am
Ryan's version would be
date(tonumber("20" & right({table.field},2)),tonumber(left({table.field},2)),tonumber(mid({table.field},4,2)))
IP Logged
docmig
Newbie
Joined: 18 Mar 2012
Location: United States
Online Status: Offline
Posts: 3
Posted: 20 Mar 2012 at 10:42am
Many thanks!
Worked perfectly.
IP Logged
Printable version
Forum Jump
-- Select Forum --
Announcements
Talk with the Author
Self-Publishing
Job Postings
New feature request
Report Design
Data Connectivity
Technical Questions
Tips and Tricks
Crystal Xcelsius
Report Design
Data Connectivity
Writing Code
Tips and Tricks
Report Design
Data Connectivity
Writing Code
Tips and Tricks
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
HOME
|
FREE EBOOK
|
PROGRAMMING GUIDE
|
PURCHASE
|
REVIEWS
|
CONTACT ME
|
FAQ
|
LINKS
|
PRIVACY
|
CLICK PLAYS
|
BAEZL
© 2004-2026 Brian Bischof. All Rights Reserved.