Aug 6, 2007 #1 NotSQL Technical User Joined May 17, 2005 Messages 205 Location GB Can anyone help me convert a date which is represented as month/day/year to day/month/year eg 10/03/2007 should be 03/10/2007 Regards Dave
Can anyone help me convert a date which is represented as month/day/year to day/month/year eg 10/03/2007 should be 03/10/2007 Regards Dave
Aug 6, 2007 1 #2 PHV MIS Joined Nov 8, 2002 Messages 53,708 Location FR A starting point: dmy = Mid(mdy,4,3) & Left(mdy,3) & Right(mdy,4) Hope This Helps, PH. FAQ219-2884 FAQ181-2886 Upvote 0 Downvote
A starting point: dmy = Mid(mdy,4,3) & Left(mdy,3) & Right(mdy,4) Hope This Helps, PH. FAQ219-2884 FAQ181-2886
Aug 6, 2007 Thread starter #3 NotSQL Technical User Joined May 17, 2005 Messages 205 Location GB Sorry PHV Im new to VBscript so think may need to explain this to me... Thanks Upvote 0 Downvote
Aug 6, 2007 #4 PHV MIS Joined Nov 8, 2002 Messages 53,708 Location FR mdy is the name of the variable holding the date represented as mm/dd/yyyy dmy will contain the same date as dd/mm/yyyy Hope This Helps, PH. FAQ219-2884 FAQ181-2886 Upvote 0 Downvote
mdy is the name of the variable holding the date represented as mm/dd/yyyy dmy will contain the same date as dd/mm/yyyy Hope This Helps, PH. FAQ219-2884 FAQ181-2886
Aug 8, 2007 1 #5 earthandfire Programmer Joined Mar 14, 2005 Messages 2,924 Location GB Try this: Code: dim kdate dim normaldate dim datebits kdate = "3/10/2007" datebits = split(kdate,"/") normaldate = cdate(datebits(1) & "/" & datebits(0) & "/" & datebits(2)) msgbox(normaldate) This allows for single or double digit days and months. Hope this helps. Upvote 0 Downvote
Try this: Code: dim kdate dim normaldate dim datebits kdate = "3/10/2007" datebits = split(kdate,"/") normaldate = cdate(datebits(1) & "/" & datebits(0) & "/" & datebits(2)) msgbox(normaldate) This allows for single or double digit days and months. Hope this helps.
Aug 8, 2007 #6 earthandfire Programmer Joined Mar 14, 2005 Messages 2,924 Location GB Sorry, I forgot to include the formatting: Code: dim kdate dim normaldate dim datebits kdate = "3/10/2007" datebits = split(kdate,"/") normaldate = formatdatetime(cdate(datebits(1) & "/" & datebits(0) & "/" & datebits(2)), 0) msgbox(normaldate) Hope this helps. Upvote 0 Downvote
Sorry, I forgot to include the formatting: Code: dim kdate dim normaldate dim datebits kdate = "3/10/2007" datebits = split(kdate,"/") normaldate = formatdatetime(cdate(datebits(1) & "/" & datebits(0) & "/" & datebits(2)), 0) msgbox(normaldate) Hope this helps.