What's faster?
This...
WHERE qryEmployeeTrainingHistory.CourseID >0 ;
Or this...?
WHERE not(isnull(qryEmployeeTrainingHistory.CourseID)) ;
What's faster?
This...
WHERE qryEmployeeTrainingHistory.CourseID >0 ;
Or this...?
WHERE not(isnull(qryEmployeeTrainingHistory.CourseID)) ;
Define faster and why is that so important? What is the context for this?
What exactly is the constraint(criteria)?
>0; not Null but maybe 0;???
another where clause to consider
WHERE qryEmployeeTrainingHistory.CourseID IS NOT NULL;
I was being nosey really.
I've got a query that extracts all employees who have attended a course.
Some may not have attended any courses - which means an empty CourseID field (foreign key).
So the query is filtering on CourseID where only those records that have an entry should be returned. The CourseID starts from 1...[n] so it could never be 0.
the question you should be asking here is: "whats standard??"
if you ever pass this one to someone, surely they will appreciate reading the former rather than the latter. in terms of speed, I'm pretty sure that the former is about .000000001 nanoseconds faster than the latter.
Hi,
using empty values or testing for empty values is always much slower on any database system I know. So try to avoid it when possible. And for large queries it can really make a difference.
If you're finetuning for speed, also look at your indexes and connection times.
succes
NG