Cause I'm stuck.
Bloody Sql.
Cause I'm stuck.
Bloody Sql.
what you tryin to do mate??
Hardware:Contrary to the odd name and translucent-grey color, Pocari Sweat does not taste like sweat
Main PC - See 'My System'
Server - Athlon XP 1700+, 1GB, 500GB HD
Laptop - Compaq AMD Turion 64 X2, 60GB HD, 1GB
Media Centre Shuttle - P4 3.0 Skt 775 Shuttle, 1GB, 120GB HD
NAS - 400GB
Home Entertainment - Xbox 360 with 37" HD LCD TV, Acoustic Energy Aegis EVO A speakers (5,1), Yamaha RXV359 AV reciever
Media Centre II - X2 4000+, 1GB, 400Gb Vista Ultimate
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.
Main PC: Asus Rampage IV Extreme / 3960X@4.5GHz / Antec H1200 Pro / 32GB DDR3-1866 Quad Channel / Sapphire Fury X / Areca 1680 / 850W EVGA SuperNOVA Gold 2 / Corsair 600T / 2x Dell 3007 / 4 x 250GB SSD + 2 x 80GB SSD / 4 x 1TB HDD (RAID 10) / Windows 10 Pro, Yosemite & Ubuntu
HTPC: AsRock Z77 Pro 4 / 3770K@4.2GHz / 24GB / GTX 1080 / SST-LC20 / Antec TP-550 / Hisense 65k5510 4K TV / HTC Vive / 2 x 240GB SSD + 12TB HDD Space / Race Seat / Logitech G29 / Win 10 Pro
HTPC2: Asus AM1I-A / 5150 / 4GB / Corsair Force 3 240GB / Silverstone SST-ML05B + ST30SF / Samsung UE60H6200 TV / Windows 10 Pro
Spare/Loaner: Gigabyte EX58-UD5 / i950 / 12GB / HD7870 / Corsair 300R / Silverpower 700W modular
NAS 1: HP N40L / 12GB ECC RAM / 2 x 3TB Arrays || NAS 2: Dell PowerEdge T110 II / 24GB ECC RAM / 2 x 3TB Hybrid arrays || Network:Buffalo WZR-1166DHP w/DD-WRT + HP ProCurve 1800-24G
Laptop: Dell Precision 5510 Printer: HP CP1515n || Phone: Huawei P30 || Other: Samsung Galaxy Tab 4 Pro 10.1 CM14 / Playstation 4 + G29 + 2TB Hybrid drive
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.....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;
Main PC: Asus Rampage IV Extreme / 3960X@4.5GHz / Antec H1200 Pro / 32GB DDR3-1866 Quad Channel / Sapphire Fury X / Areca 1680 / 850W EVGA SuperNOVA Gold 2 / Corsair 600T / 2x Dell 3007 / 4 x 250GB SSD + 2 x 80GB SSD / 4 x 1TB HDD (RAID 10) / Windows 10 Pro, Yosemite & Ubuntu
HTPC: AsRock Z77 Pro 4 / 3770K@4.2GHz / 24GB / GTX 1080 / SST-LC20 / Antec TP-550 / Hisense 65k5510 4K TV / HTC Vive / 2 x 240GB SSD + 12TB HDD Space / Race Seat / Logitech G29 / Win 10 Pro
HTPC2: Asus AM1I-A / 5150 / 4GB / Corsair Force 3 240GB / Silverstone SST-ML05B + ST30SF / Samsung UE60H6200 TV / Windows 10 Pro
Spare/Loaner: Gigabyte EX58-UD5 / i950 / 12GB / HD7870 / Corsair 300R / Silverpower 700W modular
NAS 1: HP N40L / 12GB ECC RAM / 2 x 3TB Arrays || NAS 2: Dell PowerEdge T110 II / 24GB ECC RAM / 2 x 3TB Hybrid arrays || Network:Buffalo WZR-1166DHP w/DD-WRT + HP ProCurve 1800-24G
Laptop: Dell Precision 5510 Printer: HP CP1515n || Phone: Huawei P30 || Other: Samsung Galaxy Tab 4 Pro 10.1 CM14 / Playstation 4 + G29 + 2TB Hybrid drive
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
There are currently 1 users browsing this thread. (0 members and 1 guests)