Solved

How would i take the VB.net NOW and convert to SQL date/time ?

Posted on 2004-08-12
4
286 Views
Last Modified: 2008-03-06
How would i take the VB.net NOW and convert to SQL date/time ?


8/22/2004 2:58:12 PM
to SQL date time ?
0
Comment
Question by:Vartana
  • 2
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
BillAn1 earned 500 total points
ID: 11788880
in VB.Net I believe you can use CDate(), however SQLServer will recognize '8/22/2004 2:58:12 PM'  as a valid datetime
0
 
LVL 1

Author Comment

by:Vartana
ID: 11789105
this does not work

            sSQL = " UPDATE Arrears" & _
                    " SET InUse = " & InUse & ", Called = - 1, LastView = " & Now & _
                    " WHERE CustomerAcctNumber = '" & sAccount & "' AND BillingCycleID =" & BillingCycleID
0
 
LVL 17

Expert Comment

by:BillAn1
ID: 11790955
You just need to quote it in single quotes -

sSQL = " UPDATE Arrears" & _
                    " SET InUse = " & InUse & ", Called = - 1, LastView = '" & Now & "'" & _
                    " WHERE CustomerAcctNumber = '" & sAccount & "' AND BillingCycleID =" & BillingCycleID
0
 
LVL 1

Author Comment

by:Vartana
ID: 11794425
Thanks
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now