TSQL QUERY for Date

  • Hello

    Guys, here is a problem, I am trying to explain it , but don't know how much help full it will be. Still try to give some solutions if possible.

    The problem is : I have a table named dbo.Container in a database. there is a container_key attribute in that.And also there is an attribute named Begin_Journey_Date. Now I want to count the no. of container_key with respect to last year , last quarter, and last month till date.

    What will be the suitable query for that.

    Please help me in this regard.

    Thanks

    Subhro

  • Please provide ctreate table and sample data population script for your case!

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • Hey !!!!!

    I am going to send some thing that will help to you to get the result, please go through the images I am sending,first image is the requirment , second is the view of table attributes.

    Thanks

    Subhro

  • Images will not help, please read article in my signature, and post as per it people will come up with gr8 solutions for you.

    Nag
    ------------------------------------------------
    How to get the best help on a forum

    http://www.sqlservercentral.com/articles/Best+Practices/61537

  • Sorry man, The case should be presented as:

    CREATE TABLE #TestTable (Col1, Col2, ...)

    INSERT #TestTable SELECT Val1, Val2, ...

    ...

    Please work a bit to help minimize time required to help you.

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • hi

    Subhro

    Please give us some more details about your problem so that we can try to help.

    Frankly speaking the screenshots are not of much use here.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply