Apr 2, 2004 #1 Ann28 MIS Joined Apr 2, 2004 Messages 97 Location US Hi The date is a in a string format '200301' How do I convert it into valid date format? Thanks a lot
Hi The date is a in a string format '200301' How do I convert it into valid date format? Thanks a lot
Apr 2, 2004 2 #2 vidru Programmer Joined Jul 18, 2003 Messages 2,113 Location US Assuming that your format is YYYYMM, this will return the first date of that month/year: Date(Int(200401/100), 200401 Mod 100, 1) -dave Upvote 0 Downvote
Assuming that your format is YYYYMM, this will return the first date of that month/year: Date(Int(200401/100), 200401 Mod 100, 1) -dave
Apr 2, 2004 #3 vidru Programmer Joined Jul 18, 2003 Messages 2,113 Location US Whoops, missed the "string" part... Date(Int(val({Table.Field})/100), Val({Table.Field) Mod 100, 1) -dave Upvote 0 Downvote
Whoops, missed the "string" part... Date(Int(val({Table.Field})/100), Val({Table.Field) Mod 100, 1) -dave
Apr 2, 2004 #4 synapsevampire Programmer Joined Mar 23, 2002 Messages 20,180 Location US Interesting approach, Dave, a star for creativity. I would have used the brute force: cDate("01/"+mid("200301",5)+"/"+left("200301",4)) -k Upvote 0 Downvote
Interesting approach, Dave, a star for creativity. I would have used the brute force: cDate("01/"+mid("200301",5)+"/"+left("200301",4)) -k
Apr 2, 2004 #5 vidru Programmer Joined Jul 18, 2003 Messages 2,113 Location US Thanks k, I'm all too familiar with that YYYYMM format (we use it for Billing Periods). -dave Upvote 0 Downvote
Apr 2, 2004 #6 synapsevampire Programmer Joined Mar 23, 2002 Messages 20,180 Location US I'd guess that the brute force method is faster since it doesn't do as much, but yours was clever, if not artistic. -k Upvote 0 Downvote
I'd guess that the brute force method is faster since it doesn't do as much, but yours was clever, if not artistic. -k