IS string date greater than or equal to a SQL server datetime record?

Ask a Question related to ASP, Design and Development.

  1. #1

    Default IS string date greater than or equal to a SQL server datetime record?

    I need to figure out if the current date (passed in as a string) is equal
    to or greater then a field in my database in the format of- M/D/YYYY AND if
    the date is less then another field in my database.


    "... WHERE '" & cdate(request("date")) & "' >= CONVERT(varchar,
    (datePart(M,appointmentStart)/datePart(D,appointmentStart)/datePart(YYYY,app
    ointmentStart)), 103)) AND "&_
    "'" & cdate(request("date")) & "' <= (CONVERT(varchar,
    (datePart(M,appointmentEnd)/datePart(D,appointmentEnd)/datePart(YYYY,appoint
    mentEnd)), 103)) "


    Anyone know why my SQL statement above is not working correctly?

    PS- I've always wondered why it less thEn instead of less thAn ..? Doesn't
    thAn make more sense?


    TIA


    Hebar Tiltwobler Guest

  2. Similar Questions and Discussions

    1. Greater than/Equal To Font Problem
      I just recently completed a fairly large brochure. On quite a few of the tech pages I used the special char's ? and ?. In all cased they show up in...
    2. to check to date must be greater or equal from date
      Hi All, I code my date selection like this : <select name="day" class="formData"> <cfloop index="d" from="1" to="31" step="+1"> <option...
    3. query with greater than date
      how can i make a query which recieves dates greater or equal to todays date? I tried this sql statement, but it included some dates from 2004 and...
    4. #26071 [Bgs]: Number 0 is equal to any string.
      ID: 26071 User updated by: flood87 at hot dot ee Reported By: flood87 at hot dot ee Status: Bogus Bug Type: ...
    5. #26071 [NEW]: Number 0 is equal to any string.
      From: flood87 at hot dot ee Operating system: Windows XP PHP version: 5.0.0b1 (beta1) PHP Bug Type: Unknown/Other Function...
  3. #2

    Default Re: IS string date greater than or equal to a SQL server datetime record?


    "Hebar Tiltwobler" <ready@justfooledyou-notemail.com> wrote in message
    news:%23juETYlmDHA.2140@TK2MSFTNGP09.phx.gbl...
    >
    > PS- I've always wondered why it less thEn instead of less thAn ..? Doesn't
    > thAn make more sense?
    Where are you seeing less thEn? I can see myself saying that in
    conversation. "We can each take 50%. If you want less, then give me more."

    Ray at work


    Ray at Guest

  4. #3

    Default Re: IS string date greater than or equal to a SQL server datetime record?

    Hebar Tiltwobler wrote:
    > I need to figure out if the current date (passed in as a string) is
    > equal to or greater then a field in my database in the format of-
    > M/D/YYYY AND if the date is less then another field in my database.
    Dates are not stored with any format. It is up to the client application to
    apply formatting. I suspect your database is SQL Server (why are you making
    us guess? :-) ), so if you look up Using Date And Time Data in SQL Books
    Online, you will find your answer.
    > Anyone know why my SQL statement above is not working correctly?
    >
    > PS- I've always wondered why it less thEn instead of less thAn ..?
    > Doesn't thAn make more sense?
    >
    I always say/write "less than". I don't know why you think "less then" is
    the accepted form.

    HTH,
    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 Guest

  5. #4

    Default Re: IS string date greater than or equal to a SQL server datetime record?


    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:%23hb2malmDHA.3612@TK2MSFTNGP11.phx.gbl...
    >
    > "Hebar Tiltwobler" <ready@justfooledyou-notemail.com> wrote in message
    > news:%23juETYlmDHA.2140@TK2MSFTNGP09.phx.gbl...
    >
    > >
    > > PS- I've always wondered why it less thEn instead of less thAn ..?
    Doesn't
    > > thAn make more sense?
    >
    > Where are you seeing less thEn? I can see myself saying that in
    > conversation. "We can each take 50%. If you want less, then give me
    more."
    >
    > Ray at work
    >
    >
    Whoops.. was thinking of VBscript.. > then..

    I'm wondering why it is not less than instead of then. Isn't "than"
    comparitive and "then" a reference to time?



    Hebar Tiltwobler Guest

  6. #5

    Default Re: IS string date greater than or equal to a SQL server datetime record?


    "Bob Barrows" <reb01501@NOyahoo.SPAMcom> wrote in message
    news:%23gbRhdlmDHA.2080@TK2MSFTNGP10.phx.gbl...
    > Hebar Tiltwobler wrote:
    > > I need to figure out if the current date (passed in as a string) is
    > > equal to or greater then a field in my database in the format of-
    > > M/D/YYYY AND if the date is less then another field in my database.
    >
    > Dates are not stored with any format. It is up to the client application
    to
    > apply formatting. I suspect your database is SQL Server (why are you
    making
    > us guess? :-) ), so if you look up Using Date And Time Data in SQL Books
    > Online, you will find your answer.
    >
    > > Anyone know why my SQL statement above is not working correctly?
    > >
    > > PS- I've always wondered why it less thEn instead of less thAn ..?
    > > Doesn't thAn make more sense?
    > >
    > I always say/write "less than". I don't know why you think "less then" is
    > the accepted form.
    >
    > HTH,
    > 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"
    >
    >

    > Dates are not stored with any format. It is up to the client application
    to
    > apply formatting.
    Correct
    >I suspect your database is SQL Server (why are you making
    > us guess? :-) ),
    Subject line says SQL Server


    >so if you look up Using Date And Time Data in SQL Books
    > Online, you will find your answer.


    Thank you.






    Hebar Tiltwobler Guest

  7. #6

    Default Re: IS string date greater than or equal to a SQL server datetime record?

    Less than is correct. Did you hear "then" or see "then"? Maybe you ran into
    a regional accent.

    Gotta go now, the cah's erl needs to be changed.

    Bob Lehmann

    "Hebar Tiltwobler" <ready@justfooledyou-notemail.com> wrote in message
    news:uo9dTrlmDHA.2964@tk2msftngp13.phx.gbl...
    >
    > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    > news:%23hb2malmDHA.3612@TK2MSFTNGP11.phx.gbl...
    > >
    > > "Hebar Tiltwobler" <ready@justfooledyou-notemail.com> wrote in message
    > > news:%23juETYlmDHA.2140@TK2MSFTNGP09.phx.gbl...
    > >
    > > >
    > > > PS- I've always wondered why it less thEn instead of less thAn ..?
    > Doesn't
    > > > thAn make more sense?
    > >
    > > Where are you seeing less thEn? I can see myself saying that in
    > > conversation. "We can each take 50%. If you want less, then give me
    > more."
    > >
    > > Ray at work
    > >
    > >
    >
    > Whoops.. was thinking of VBscript.. > then..
    >
    > I'm wondering why it is not less than instead of then. Isn't "than"
    > comparitive and "then" a reference to time?
    >
    >
    >

    Bob Lehmann Guest

  8. #7

    Default Re: IS string date greater than or equal to a SQL server datetime record?


    "Hebar Tiltwobler" <ready@justfooledyou-notemail.com> wrote in message
    news:uo9dTrlmDHA.2964@tk2msftngp13.phx.gbl...
    >
    > > Where are you seeing less thEn? I can see myself saying that in
    > > conversation. "We can each take 50%. If you want less, then give me
    > more."
    > >
    > > Ray at work
    > >
    > >
    >
    > Whoops.. was thinking of VBscript.. > then..
    >
    > I'm wondering why it is not less than instead of then. Isn't "than"
    > comparitive and "then" a reference to time?
    >
    [url]www.dictionary.com[/url]
    just kidding

    If 5 is greater than 4 then do this

    That's how VBS is, although I wouldn't be surprised if things were messed up
    grammatically from time to time. I don't know too many programmers who are
    expert grammarians. I try though! I don't use "a lot" or say things like,
    "If someone has a cat, they are cool." Who's they? It's he, damn it! And
    enough with all that "he or she" or "s/he" nonsense!

    Ray at work
    >
    >

    Ray at Guest

  9. #8

    Default Re: IS string date greater than or equal to a SQL server datetime record?


    "Bob Lehmann" <none> wrote in message
    news:eFFaW0lmDHA.1072@TK2MSFTNGP09.phx.gbl...
    > Less than is correct. Did you hear "then" or see "then"? Maybe you ran
    into
    > a regional accent.
    >
    > Gotta go now, the cah's erl needs to be changed.
    >
    > Bob Lehmann
    >
    > "Hebar Tiltwobler" <ready@justfooledyou-notemail.com> wrote in message
    > news:uo9dTrlmDHA.2964@tk2msftngp13.phx.gbl...
    > >
    > > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    > > news:%23hb2malmDHA.3612@TK2MSFTNGP11.phx.gbl...
    > > >
    > > > "Hebar Tiltwobler" <ready@justfooledyou-notemail.com> wrote in message
    > > > news:%23juETYlmDHA.2140@TK2MSFTNGP09.phx.gbl...
    > > >
    > > > >
    > > > > PS- I've always wondered why it less thEn instead of less thAn ..?
    > > Doesn't
    > > > > thAn make more sense?
    > > >
    > > > Where are you seeing less thEn? I can see myself saying that in
    > > > conversation. "We can each take 50%. If you want less, then give me
    > > more."
    > > >
    > > > Ray at work
    > > >
    > > >
    > >
    > > Whoops.. was thinking of VBscript.. > then..
    > >
    > > I'm wondering why it is not less than instead of then. Isn't "than"
    > > comparitive and "then" a reference to time?
    > >
    > >
    > >
    >
    >

    I was thinking (not really) of "less than" or "greater than" (<>) and
    "then"... what I'm really trynig to say is that I woke up too early this
    morning.





















    Hebar Tiltwobler Guest

  10. #9

    Default Re: IS string date greater than or equal to a SQL server datetime record?


    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:%23wZLj2lmDHA.2436@TK2MSFTNGP09.phx.gbl...
    >
    > "Hebar Tiltwobler" <ready@justfooledyou-notemail.com> wrote in message
    > news:uo9dTrlmDHA.2964@tk2msftngp13.phx.gbl...
    > >
    > > > Where are you seeing less thEn? I can see myself saying that in
    > > > conversation. "We can each take 50%. If you want less, then give me
    > > more."
    > > >
    > > > Ray at work
    > > >
    > > >
    > >
    > > Whoops.. was thinking of VBscript.. > then..
    > >
    > > I'm wondering why it is not less than instead of then. Isn't "than"
    > > comparitive and "then" a reference to time?
    > >
    >
    > [url]www.dictionary.com[/url]
    > just kidding
    >
    > If 5 is greater than 4 then do this
    >
    > That's how VBS is, although I wouldn't be surprised if things were messed
    up
    > grammatically from time to time. I don't know too many programmers who
    are
    > expert grammarians. I try though! I don't use "a lot" or say things
    like,
    > "If someone has a cat, they are cool." Who's they? It's he, damn it!
    And
    > enough with all that "he or she" or "s/he" nonsense!
    >
    > Ray at work
    >
    > >
    > >
    >
    >
    Tomaytoe tomot-o, potatoe, now that I've invented the internet I'm going
    back to bed.









    Hebar Tiltwobler Guest

  11. #10

    Default Re: IS string date greater than or equal to a SQL server datetime record?

    Hebar Tiltwobler wrote:
    >> I suspect your database is SQL Server (why are you making
    >> us guess? :-) ),
    >
    Oops. Sorry about that.

    Bob


    --
    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 Guest

Posting Permissions

  • You may not post new threads
  • You may 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