Professional Web Applications Themes

Getting 0 recordset in MS Access Query - ASP Database

Hi, I'm trying to do a sql query on a date column, like this SELECT * FROM [PSUSA] WHERE Call_Date = #04/01/2004# No errors in the statement, but 0 recordsets found. I have plenty dates with this. Also, my actual contents in Call_Date field has time as well. I just need to query on dates not time. Example how the data is in the field. "4/23/2004 10:59:15 AM" Any ideas what I could be doing wrong. Us MS Access 2002 version. Thanks, jt...

  1. #1

    Default Getting 0 recordset in MS Access Query

    Hi,

    I'm trying to do a sql query on a date column, like this

    SELECT * FROM [PSUSA] WHERE Call_Date = #04/01/2004#

    No errors in the statement, but 0 recordsets found. I have plenty dates with
    this.

    Also, my actual contents in Call_Date field has time as well. I just need to
    query on dates not time.

    Example how the data is in the field. "4/23/2004 10:59:15 AM"

    Any ideas what I could be doing wrong. Us MS Access 2002 version.

    Thanks,
    jt




    jt Guest

  2. #2

    Default Re: Getting 0 recordset in MS Access Query

    jt wrote:
    > Hi,
    >
    > I'm trying to do a sql query on a date column, like this
    >
    > SELECT * FROM [PSUSA] WHERE Call_Date = #04/01/2004#
    >
    > No errors in the statement, but 0 recordsets found. I have plenty
    > dates with this.
    >
    > Also, my actual contents in Call_Date field has time as well. I just
    > need to query on dates not time.
    >
    > Example how the data is in the field. "4/23/2004 10:59:15 AM"
    >
    > Any ideas what I could be doing wrong. Us MS Access 2002 version.
    >
    > Thanks,
    > jt
    WHERE Call_Date >= #2004/04/01# AND Call_Date < DATEADD("d",1,#2004/04/01#)

    Bob Barrows

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Barrows [MVP] Guest

  3. #3

    Default Re: Getting 0 recordset in MS Access Query


    "Bob Barrows [MVP]" <reb01501NOyahoo.SPAMcom> wrote in message
    news:uLB7uC4PEHA.3232TK2MSFTNGP11.phx.gbl...
    > jt wrote:
    > > Hi,
    > >
    > > I'm trying to do a sql query on a date column, like this
    > >
    > > SELECT * FROM [PSUSA] WHERE Call_Date = #04/01/2004#
    > >
    > > No errors in the statement, but 0 recordsets found. I have plenty
    > > dates with this.
    > >
    > > Also, my actual contents in Call_Date field has time as well. I just
    > > need to query on dates not time.
    > >
    > > Example how the data is in the field. "4/23/2004 10:59:15 AM"
    > >
    > > Any ideas what I could be doing wrong. Us MS Access 2002 version.
    > >
    > > Thanks,
    > > jt
    >
    > WHERE Call_Date >= #2004/04/01# AND Call_Date <
    DATEADD("d",1,#2004/04/01#)
    >
    > Bob Barrows
    >
    Thanks! Worked great!

    Now the problem is getting how to get a popup box to along the use enter the
    dates as parameters, then the query to execute.

    jt


    jt Guest

  4. #4

    Default Re: Getting 0 recordset in MS Access Query

    jt wrote:
    >>
    >> WHERE Call_Date >= #2004/04/01# AND Call_Date <
    >> DATEADD("d",1,#2004/04/01#)
    >>
    >> Bob Barrows
    >>
    >
    > Thanks! Worked great!
    >
    > Now the problem is getting how to get a popup box
    ? Why do you need a popup?
    If you're convinced you need a popup, then you need to use client-side code
    which is off-topic in an asp newsgroup. Look for a group with "dhtml" in its
    name, or go to one of the .scripting groups: probably the jscript group.
    > to along the use
    > enter the dates as parameters, then the query to execute.
    >
    The user should only need to enter a single date.

    If you are testing the query in Access (recommended), change the query to
    this:

    .... WHERE Call_Date >= [pDate] AND Call_Date < DATEADD("d",1,[pDate])

    When you test it, Access will prompt you for the value to be used for the
    pDate parameter. When you run it from asp, you will supply that value
    programmatically.

    When you are satisfied that the query works, save it in Access, giving it a
    name such as qGetCallsByDate. In asp, do this:

    <%
    dim dDate, cn, rs
    dDate = cDate(request.form("date"))
    'create and open the connection object
    set rs=server.createobject("adodb.recordset")
    cn.qGetCallsByDate dDate, rs
    'process the data in the recordset
    %>

    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Barrows [MVP] Guest

  5. #5

    Default Re: Getting 0 recordset in MS Access Query


    "Bob Barrows [MVP]" <reb01501NOyahoo.SPAMcom> wrote in message
    news:eU5QmU$PEHA.3660tk2msftngp13.phx.gbl...
    > jt wrote:
    > >>
    > >> WHERE Call_Date >= #2004/04/01# AND Call_Date <
    > >> DATEADD("d",1,#2004/04/01#)
    > >>
    > >> Bob Barrows
    > >>
    > >
    > > Thanks! Worked great!
    > >
    > > Now the problem is getting how to get a popup box
    >
    > ? Why do you need a popup?
    > If you're convinced you need a popup, then you need to use client-side
    code
    > which is off-topic in an asp newsgroup. Look for a group with "dhtml" in
    its
    > name, or go to one of the .scripting groups: probably the jscript group.
    >
    > > to along the use
    > > enter the dates as parameters, then the query to execute.
    > >
    > The user should only need to enter a single date.
    >
    > If you are testing the query in Access (recommended), change the query to
    > this:
    >
    > ... WHERE Call_Date >= [pDate] AND Call_Date < DATEADD("d",1,[pDate])
    >
    > When you test it, Access will prompt you for the value to be used for the
    > pDate parameter. When you run it from asp, you will supply that value
    > programmatically.
    >
    > When you are satisfied that the query works, save it in Access, giving it
    a
    > name such as qGetCallsByDate. In asp, do this:
    >
    > <%
    > dim dDate, cn, rs
    > dDate = cDate(request.form("date"))
    > 'create and open the connection object
    > set rs=server.createobject("adodb.recordset")
    > cn.qGetCallsByDate dDate, rs
    > 'process the data in the recordset
    > %>
    >
    > Bob Barrows
    > --
    That is exactly what I wish to do, to have it prompt the user to enter the
    date.

    Thanks for this lesson.

    jt


    jt Guest

Similar Threads

  1. Problems with Recordset (Query) in Dreamweaver BindingsPanel
    By ChuckRWD in forum Coldfusion Database Access
    Replies: 2
    Last Post: November 24th, 05:53 PM
  2. recordset query not working
    By Don Pacino in forum Dreamweaver AppDev
    Replies: 5
    Last Post: April 2nd, 09:13 PM
  3. ASP/SQL Query Recordset up to 200 characters?
    By Speegs in forum Dreamweaver AppDev
    Replies: 3
    Last Post: March 17th, 03:47 PM
  4. Replies: 1
    Last Post: March 3rd, 02:15 PM
  5. PHP & Simple Recordset Query
    By myvette webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 0
    Last Post: July 16th, 07:31 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139