Results 1 to 4 of 4

Thread: Enforcing a double value in SQL

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2002
    Posts
    61

    Enforcing a double value in SQL

    I'm writing a VB app which sends an SQL statement to SQL Server:

    strSQL = "select * from systemevents where timestamp >= " + CStr(LastEventTimestampRead) + " order by timestamp"

    strSQL = the SQL statement
    timestamp = field with date and time value, in date and time format.
    LastEventTimestampRead = double variable from external source, representing a time value.

    How do I convert the timestamp value into a DOUBLE value, so I can compare it with the LastEventTimestampRead variable? I tried CDbl but that' a VB command and not SQL.

    Thanks.

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Enforcing a double value in SQL

    SQL SQL? Or Access SQL??
    SQL - use the CONVERT function
    If Access SQL, then CDbl oddly enough should work.

    Tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2002
    Posts
    61

    Re: Enforcing a double value in SQL

    I'm using MS Sequel Server.
    Can you please tell me the syntax of the "Convert" function?

    Thanks.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Enforcing a double value in SQL

    Here is some information that I think you will find useful.

    http://www.databasejournal.com/featu...le.php/2197931

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width