473,320 Members | 1,695 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 25139

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Marc Pelletier | last post by:
Hello, I have a table with a Day field, defined as smalldatetime. I am filling it from a CSharp application with the following code: DataRow r = dtStaDays.NewRow(); r= station_ID; r =...
4
by: djc | last post by:
I am confused with all the options for date values... What should I be using when I want to compare (=, >, <) two dates, not including the time.. for example when inserting data in a database the...
6
by: Maileen | last post by:
Hi, I have the following code : Function GetRequestType(ByVal EvDt As String, ByVal StPeriod As String, ByVal EdPeriod As String, ByVal TaskType As String) As Integer Dim strtest As String Dim...
10
by: Robert | last post by:
I would like to run a report for each month over two years. I am currently using a date range like this. Then manually substitute the error_time bounds for each month and rerun the query. How...
1
by: Budd | last post by:
Hi everyone i got a problem on date, it is... 1, i get the date from calendar component 2, compare today and selected date is equal (compare method) 3 count the number of day between this...
7
by: No bother | last post by:
I have a table which has, among other fields, a date field. I want to get a count of records where certain criteria are met for, say, three days in a row. For example: NumWidgets Date...
4
by: Simon Gare | last post by:
Hi all, I am trying to retrieve a count of booking entries made 30 days ago, below is the end of the query I am having problems with. dbo.booking_form.TimeOfBooking = DATEADD(day, -30,...
2
by: Brian Parker | last post by:
I am beginning to work with VB2005.NET and I'm getting some problems with string formatting converting an application from VB6. VB6 code:- sTradeDate = Format(pArray(4,i Record), "mmddyy") ...
2
by: bml337 via AccessMonster.com | last post by:
I need to create a supervisory log for my clients. The log table has the following fields date, checkbox and notes. now for the tricky part... one log is weekly and should be generated every...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.