Skip to Content
avatar image
Former Member

GetDate() in query generator doesn' return the time!

If I issue the following statement in transact sql (via a qry in mssql 2005):

select getdate()

what I get is :2007-04-11 15:48:53.557

The same statement in query generator gives me: 04/11/07

Why the difference and how do I get the current time (from query generator - not vb code)?


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Apr 11, 2007 at 08:29 PM

    Hi John,

    The time is actually returned to SBO by the getdate() command but SBO is automatically formatting the field according to your company settings. In most cases this will display a datetime field as just the date.

    For display purposes you can do something like this:

    select DocNum, CardCode, cast(getdate() as nvarchar) from ORDR where DocDate < getdate()

    Kind Regards,


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Owen Slater

      Thanks owen for this code. It's very useful for me. I am planning to connect this query to OPOR with a pop-up alert that indicates from 12hrs generation of the document.

      Best Regards,