It worked, Dateadd(day, -1, convert(char(7),dateadd(month, 25, [FINALSUITDONE]),120)+'-01') WORKED LIKE A CHAMP!!!!!
I went in the query analyzer and did a select statement exactly like this
SELECT DATEADD(day, -1, convert(char(7), dateadd(month, 25, [FINALSUITDONE]),120)+'-01')
and after alot of analyzing and reading it worked and I now understand what I was doing wrong.
I would like to thank BLINDMAN(DATA JANITOR) FOR HELPING ME. HE IS A SQL GURU. I now understand what he was trying to tell me
thank you so much guys
I bought some sql query books from amazon, can anyone recommend any good books on sql server 2000 queries I should get. This is an awesome forums site, I should donate. (how would I go about doing that btw??)
Now take the next step and create a user-defined function to use in your code instead. It will make debugging easier six months from now, and you can reuse it without having to try to remember how you the code was written.
I think this syntax will work:
create function LastDayOfMonth(MonthDate as Datetime)
return Dateadd(day, -1, convert(char(7),dateadd(month, 25, MonthDate),120)+'-01')
...and you use it like this:
SELECT dbo.LastDayOfMonth([FINALSUITDONE]) FROM LICENSE_STATUS
Now isn't that a lot easier to read and understand?
If it's not practically useful, then it's practically useless.
Thank you again blindman I have one more sql class to take. And the more I learn about sql the more I want to take the exam and be a dba. I was wondering if you had any advice on what kinds of practice test and books I should purchase to assist me in passing the exam? Now that I'm getting alot of hands on experience I'm sure that will help me alot.