Professional Web Applications Themes

ASP with SQL Command problem - ASP Database

strSQL = "SELECT * FROM list" strSQL = strSQL & " Where date1 > '10/30/2004' and date1 < '11/2/2004'" It returns the result: date1 ----------- 1/1/2004 10/7/2004 10/5/2004 10/4/2004 Why does it not match the range?...

  1. #1

    Default ASP with SQL Command problem

    strSQL = "SELECT * FROM list"
    strSQL = strSQL & " Where date1 > '10/30/2004' and date1 < '11/2/2004'"

    It returns the result:


    date1
    -----------
    1/1/2004
    10/7/2004
    10/5/2004
    10/4/2004

    Why does it not match the range?

    (^_^) Guest

  2. #2

    Default Re: ASP with SQL Command problem

    Is your column a date type, i.e. datetime or smalldatetime? If not, your <
    and > comparisons will be text-based.

    Also, read up on date formats here: http://www.aspfaq.com/show.asp?id=2260

    Additionally, what database type?

    Ray at home

    "(^_^)" <com> wrote in message
    news:BDB276AF.F85%com... 


    Ray Guest

  3. #3

    Default Re: ASP with SQL Command problem

    (^_^) wrote: 

    What database type and version are you using?
    What is the datatype of the date1 column?
    Why does the column name have a number in it? This is usually an indication
    of less-than-optimum database design.

    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 Guest

  4. #4

    Default Re: ASP with SQL Command problem

    It is general datetime.

    in article phx.gbl, Ray Costanzo [MVP] at my
    first name at lane 34 dot commercial wrote on 6/11/04 14:53:
     
    >
    >[/ref]

    (^_^) Guest

Similar Threads

  1. Problem with Publish Web Command
    By j.d.smith in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 0
    Last Post: May 11th, 02:39 PM
  2. problem with file(url) command
    By Philippe in forum PHP Development
    Replies: 3
    Last Post: August 6th, 12:22 AM
  3. FP9: Problem with IMPORT command
    By Perry R Shindle in forum IBM DB2
    Replies: 1
    Last Post: August 26th, 10:18 PM
  4. DB2 8.1.2 - get dbm cfg command problem
    By Perry R Shindle in forum IBM DB2
    Replies: 5
    Last Post: July 25th, 05:54 PM
  5. Command Button problem
    By Graham R Seach in forum Microsoft Access
    Replies: 1
    Last Post: July 1st, 03:21 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