Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-08-12
4
Medium Priority
?
308 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
BillAn1 earned 2000 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

618 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