470,821 Members | 2,077 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,821 developers. It's quick & easy.

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
Jul 19 '05 #1
9 25015

"Hebar Tiltwobler" <re***@justfooledyou-notemail.com> wrote in message
news:%2****************@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
Jul 19 '05 #2
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"
Jul 19 '05 #3

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...

"Hebar Tiltwobler" <re***@justfooledyou-notemail.com> wrote in message
news:%2****************@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?

Jul 19 '05 #4

"Bob Barrows" <re******@NOyahoo.SPAMcom> wrote in message
news:%2****************@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.


Jul 19 '05 #5
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" <re***@justfooledyou-notemail.com> wrote in message
news:uo**************@tk2msftngp13.phx.gbl...

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...

"Hebar Tiltwobler" <re***@justfooledyou-notemail.com> wrote in message
news:%2****************@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?

Jul 19 '05 #6

"Hebar Tiltwobler" <re***@justfooledyou-notemail.com> wrote in message
news:uo**************@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?


www.dictionary.com
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

Jul 19 '05 #7

"Bob Lehmann" <none> wrote in message
news:eF**************@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" <re***@justfooledyou-notemail.com> wrote in message
news:uo**************@tk2msftngp13.phx.gbl...

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...

"Hebar Tiltwobler" <re***@justfooledyou-notemail.com> wrote in message
news:%2****************@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.







Jul 19 '05 #8

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...

"Hebar Tiltwobler" <re***@justfooledyou-notemail.com> wrote in message
news:uo**************@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?


www.dictionary.com
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.



Jul 19 '05 #9
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"
Jul 19 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Marc Pelletier | last post: by
4 posts views Thread by djc | last post: by
6 posts views Thread by Maileen | last post: by
10 posts views Thread by Robert | last post: by
1 post views Thread by Budd | last post: by
4 posts views Thread by Simon Gare | last post: by
2 posts views Thread by bml337 via AccessMonster.com | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.