Solved

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

Posted on 2004-08-12
4
295 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 Solution for AWS

Read about how CloudBerry Backup fully integrates your backups with Amazon S3 and Amazon Glacier to provide military-grade encryption and dramatically cut storage costs on any platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

726 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