Nice to be back to SQLTeam forum & in previous thanks you for all your helps.

I have one question needs help with I'm try to run a query select the data call "SaleDate" contain char(8) field. Basicly I want to retrieve data for 2 months (November,December) and i don't want date & year just falling in those months.

That error usually means you have something in your table that really can't be a date,like February 30th('20070230'). Try thisselect * from directtax where isdate(saledate) = 0.There may be values that aren't yyyymmdd.

That error usually means you have something in your table that really can't be a date,like February 30th('20070230'). Try thisselect * from directtax where isdate(saledate) = 0.There may be values that aren't yyyymmdd.

Jim

Hello, JimI tested your select statement "above" that my data field show 19891000 "yyyymmdd". What if the data type is the same "char"? what is the equal = 0 mean? Would I able to select by month only?

That error usually means you have something in your table that really can't be a date,like February 30th('20070230'). Try thisselect * from directtax where isdate(saledate) = 0.There may be values that aren't yyyymmdd.

Jim

Hello, JimI tested your select statement "above" that my data field show 19891000 "yyyymmdd". What if the data type is the same "char"? what is the equal = 0 mean? Would I able to select by month only?

rvan,my query was just to test the integrity of your data "ISDATE(saledate) = 0 " means that saledate can't be converted to a date. "ISDATE(saledate) = 1" means that it could be.In your case 19891000 is October 0,1989, whichisn't a real date, it's out-of-range. But Peso's first method picks that up. You just should be awarethat there may be other problems in that field, like someone entered a date in mmddyyyy format.Good luck!Jim

Well if your SQL/DBA/Database folk are storing dates in text columns it might be as well to see if they have a good reason, or to nudge then in the direction of storing them in a [s]datatype[s/] datatime datatype column.

Validation guaranteedRange-query guaranteedDate calculation - like "Add one year" - guaranteed - even adding 1 year to 29th Feb, or one month to 31st Jan, etc