Results 1 to 13 of 13
  1. #1
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Talking Unanswered: Yeah!!!!!!!! Woohooo

    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

    USE GamingDB
    GO
    SELECT DATEADD(day, -1, convert(char(7), dateadd(month, 25, [FINALSUITDONE]),120)+'-01')
    FROM LICENSE_STATUS
    GO
    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??)

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Great!

    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)
    returns datetime
    as
    begin
    return Dateadd(day, -1, convert(char(7),dateadd(month, 25, MonthDate),120)+'-01')
    end


    ...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.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Recommendations

    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.

    Thank you again

  4. #4
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    You can take an exam and become a dba?

    That is so cool.
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  5. #5
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Yes, Brett. Mine was on the side of a box of Cocoa-Puffs.

  6. #6
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    The only exam I had to take involved me peeing in a cup. I passed with nearly 100% accuracy.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  7. #7
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Does that mean you didn't miss the cup?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  8. #8
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Almost 100%. But hey, it was a really little cup.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  9. #9
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    What do you think your accuracy would be after several 'ritas?

    And when did you blow by 2k?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  10. #10
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Heck, the Margarita glasses are easy. They're really wide. Now champagne flutes are strictly for the most advanced dbas.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  11. #11
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    no.no.no...

    hit the little AFTER having many 'ritas....

    Or did you start without me?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  12. #12
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by Brett Kaiser
    What do you think your accuracy would be after several 'ritas?

    And when did you blow by 2k?
    Heck, you're about to blow by 3k, so whyfor you give the blindman grief ?!?!

    I'll bet he could still hit the little cup after the third 'rita. I'll let someone else confirm that though, I'll just take his word for it!

    -PatP

  13. #13
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Talking Oh Good Grief you guys..LOL

    Nevermind Blindman obviously you didnt have to take a certification test. I was refering to the 70-228 sql server test.

    YOu guys are too funny
    Thanks again for your help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •