Cause I'm stuck. :P
Bloody Sql.
Printable View
Cause I'm stuck. :P
Bloody Sql.
what you tryin to do mate??
It's sounds stupid, I'm trying to make a report based showing records inbetween two inputted dates. And it's working it out as Integer instead of dates
SELECT *
FROM tblproblem INNER JOIN tblequipment ON tblproblem.[Tech Number]=tblequipment.[Tech Number]
WHERE Month([Date reported]) Between forms!frmtest!month1.value And forms!frmtest!month2.value And Year([Date reported]) Between forms!frmtest!year1.value And forms!frmtest!year2.value;
:S
Any clue?
The Month() and Year() date functions return integer values.
If that was a solution I didn't catch it. Sorry. Grrr. Once I've nailed this, my Database is finished. FINISHED I TELL YOU. Then it's back to work on the staff intranet. *Sigh*
I can only presume you are refering to your Between criteria when you say this, hense I told you the functions you are using convert your date integer.....Quote:
And it's working it out as Integer instead of dates
Why not pass the dates as a datetime from the front-end and use that as your criteria? Rather then converting the date to sepearate integers?
SELECT *
FROM tblproblem INNER JOIN tblequipment ON tblproblem.[Tech Number]=tblequipment.[Tech Number]
WHERE [Date reported] Between forms!frmtest!Date1.value And forms!frmtest!Date2.value;
A much better plan is to let the user write in a date in dd/mm/yy and do what you said. The things you can't see when you're intensely concentrating!
meh - i've got some sql which will not use an index, no matter what you try.
using a range scan works, but I've got to get (for example) 1000 records on from the first record - but using limit in mysql won't use the index for this particular query - will do for others, but not this one!
i know sql