VBscript: Format date

by "Dahlstrom, Marie" <marie.dahlstrom(at)se.unisys.com>

 Date:  Thu, 3 Feb 2000 05:56:33 -0500
 To:  "Hwg-Languages@Hwg. Org (E-mail)" <hwg-languages(at)hwg.org>
  todo: View Thread, Original
Hello list,

I have spent hours trying to figure out why my VBscript doesn't work. 
I'm trying to convert a date (datetime) taken from a SQL db to another
format.

date below = the columname
When using an Access db I can use following: Format$([date], 'yyyy mm dd')
It works fine and gives 2000 02 03

For the SQL db I tried: Format(date, "yyyy mm dd")
then I get a type mismatch error .

I have tried:

convert(char(12), datum, 113) but this doesn't give me the freedom to format
the date as I please.

My programming skills are not of the expert sort and I'm sure I missed out a
comma or something but I can't figure out what I've done wrong.

Regards
Marie



 

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.