About
Pricing
Community
Teams
Start Free Trial
Log in
Richard Korts
asked on
1/7/2014
MySQL query with substring
What is wrong with this:
SELECT * FROM `citrans` WHERE substring(dtstamp,0,4) = '2012'.
See attached for structure of table citrans.
There are hundreds of records with year = 2012.
citrans-str.jpg
MySQL Server
3
2
Last Comment
Kent Dyer
8/22/2022 - Mon
SOLUTION
Dave Baldwin
1/7/2014
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Justin Pilditch
1/7/2014
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Kent Dyer
1/7/2014
Have a look here - I think this what you are looking for..
http://sqlfiddle.com/#!2/c00121/4
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
http://sqlfiddle.com/#!2/c00121/4