Results 1 to 2 of 2

Thread: how can I determine what grid displays by current date?

  1. #1
    Bart Snell Guest

    how can I determine what grid displays by current date?


    I'd like to have ASP-db first check what the current date is, then bring up the grid view using the current date as the sort criteria for initial view. Is this possible?

  2. #2
    Bart Guest

    how can I determine what grid displays by current date? (reply)

    Doesn't work... I just get the following error when I use the code you suggested:


    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

    [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Date > 1/4/01 4:11:42 PM'.

    /asp/sched2001_copy.asp, line 67

    Here's the line I'm using:

    MyDb.dbSQL = "Select * from 2001 WHERE Date > " & Now() & " ORDER BY Date ASC"

    Table name = 2001
    field name = Date

    Thanks!
    --Bart

    ------------
    John at 1/4/01 3:19:56 PM


    Hi Bart,

    You can contruct your dbSQL statement to use today's date if you wish.

    If all you want to do is to sort your grid by date descending, and say you had a date field called InvoiceDate, you'd say:

    x.dbSQL = "SELECT * from myTable ORDER BY InvoiceDate DESC"

    If however, you only wanted to see the invoices where they're greater than today's date, you might say:

    x.dbSQL = "SELECT * from myTable WHERE InvoiceDate > " & Now() & " ORDER BY InvoiceDate DESC"

    That would drop in "today's date" into your WHERE expression.

    Pick up a good book on SQL and see all the things you can do.

    Take care,
    John

    ------------
    Bart Snell at 12/30/00 11:40:39 AM


    I'd like to have ASP-db first check what the current date is, then bring up the grid view using the current date as the sort criteria for initial view. Is this possible?

Posting Permissions

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