I am wrapping up a Question of the Week application today, and while
doing my checks, I cam across an issue.
My database is like:
QOW_Start (datetime)
QOW_End (datetime)
QOW_Text
QOW_Type
Ok, so say I have the following data:
10/11/2002
10/11/2002
Testing the system.
all
I am checking in the
validation code running after the query.
Wouldn't you want the validation to take place before the query?
Andy
-Original Message-
From: Candace Cottrell [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 14, 2002 7:27 AM
To: CF-Talk
Subject: Weekly question - integrity checks
I am wrapping up
I think you have an expression ordering issue. SQL evaluates ANDs before
ORs, so you're getting all records QOW_Start = '#StartDate#' as well as all
records where QOW_End = '#EndDate#' AND QOW_Type = '#form.type#'
Try changing your WHERE clause to:
Where (
QOW_Start = '#StartDate#'
ensure that you are getting exactly what you intended :)
-mk
-Original Message-
From: Candace Cottrell [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 14, 2002 9:27 AM
To: CF-Talk
Subject: Weekly question - integrity checks
I am wrapping up a Question of the Week application today
Ewww yes, I see what you mean.
Now, I also see another problem.
The range isn't being properly identified.
For example, I'm saying
Where QOW_Start is less than or equal to 10/13 -- so this is
returning true because the data in the db is 10/11
or
Where QOW_end is greater than or
:[EMAIL PROTECTED]]
Sent: Monday, October 14, 2002 10:48 AM
To: CF-Talk
Subject: RE: Weekly question - integrity checks
Ewww yes, I see what you mean.
Now, I also see another problem.
The range isn't being properly identified.
For example, I'm saying
Where QOW_Start is less than
to or later than your start
date.
QOW_Start = '#EndDate#' OR QOW_End = '#StartDate#'
-Original Message-
From: Candace Cottrell [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 14, 2002 10:48 AM
To: CF-Talk
Subject: RE: Weekly question - integrity checks
Ewww yes, I see what you mean
Candace Cottrell wrote:
Ewww yes, I see what you mean.
Now, I also see another problem.
The range isn't being properly identified.
Hmm, if you are only entering dates, why timestamp instead of date?
For your problem, if your database supports it, use OVERLAPS:
SELECT *
FROMQOW
8 matches
Mail list logo