Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 352
  • Last Modified:

Converting date time

how do i convert

     7/12/2000 3:11:36 PM                    to               07-12-2000
     or
     10/25/2000 2:02:29 PM                  to               10-25-2000

the basic requirements being 10 characters and dashes as dividers

using access 2000 at the moment and preferring a Query

thanks!
0
intsup
Asked:
intsup
  • 2
3 Solutions
 
Rey Obrero (Capricorn1)Commented:


         format(#7/12/2000 3:11:36 PM#,"mm-dd-yyyy")


0
 
Paul_Harris_FusionCommented:
If your date is stored as a DateTime then

Select Format(mycolumn, "dd-mm-yyyy") as DateString From myTable

If your date is currently stored as a string you could try converting it to a string first using CDate then using Format to render it as a string

Select Format( CDate(mycolumn), "dd-mm-yyyy") as DateString From myTable
0
 
Dale FyeCommented:
Format(#7/12/2000 3:11:36 PM#, "mm-dd-yyyy")
0
 
Rey Obrero (Capricorn1)Commented:
or using your field name

 format([dateField],"mm-dd-yyyy")

take note that this will return a text string not date
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now