Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
|
SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 6th, 2004, 01:28 AM
Authorized User
 
Join Date: Feb 2004
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default data type for date in msde

Hi,
HI

I am using msde with asp. In my asp page I am geting the date like
dim addate
addate =date

which give me date in this format mm/dd/yyyy

Now I need to insert this date into my msde table, what data type should I use. I tried datetime and it did not work , when I go to my table all I see 12.00 PM.

Thanks


 
Old March 9th, 2004, 10:20 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

I believe dateTime will expect just that. Do you not have a date data type as an option? I personaly use smallDateTime and insert it in the mm/dd/yyy format also. However here in Australia our format is dd/mm/yyy

Here is a handy function that will convert between these two formats. NOTE: This function will place single quotes around the result, you do not need them in your insert statement
EG:: ..& '" returnedvalue "' &.. becomes ..& " returnedvalue " &..

FUNCTION amDate(varDate)
  amDate = "'" & Month(DateValue(varDate)) & "/" & Day(DateValue(varDate)) & "/" & Year(DateValue(varDate)) & " " & TimeValue(varDate) & "'"
END FUNCTION

Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting Problem in DATE/TIME Data type in MS Acces selam70 Classic ASP Databases 2 September 4th, 2004 02:31 PM
Data type in MSDE isheikh All Other Wrox Books 0 March 4th, 2004 04:14 PM
change data type to date kherboon Access 2 July 29th, 2003 10:33 PM
Change data type to DATE in SQL kherboon SQL Server 2000 4 July 28th, 2003 10:27 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.