Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2010
    Posts
    20

    Unanswered: Litle help from the experts here?

    Hello to everyone i have table
    and their are dates in it about 25 different dates

    their are two rows which have exactly the same date in it but different year

    All i want is to display these two rows


    I have tried something like that but it doesnt work any idea?

    select * from Trancactions where Trancactions.Date_Filled
    >= '03/01/2010' and Trancactions.Date_Filled <= '03/31/2010'
    select * from Trancactions IN(03/01/2010)

  2. #2
    Join Date
    Apr 2010
    Location
    Charlotte, NC
    Posts
    11
    To display just the two rows you should be able to use
    SELECT column1, column2 FROM tableName
    I'm not sure I completely understand your request. I also think you may be asking how to limit the two columns as well, in which case you'd want to use:
    SELECT
    column1
    , column2
    FROM tableName
    WHERE
    column1 >= '3/1/2010'
    AND column2 <= '3/31/2010'
    Again, I'm not sure I completely understand your request.
    ---
    Shannon Lowder
    Database Engineer
    http://toyboxcreations.net

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    where dateadd(year, -datediff(year, 0, [Date1]), [Date1]) = dateadd(year, -datediff(year, 0, [Date2]), [Date2])
    If it's not practically useful, then it's practically useless.

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

  4. #4
    Join Date
    Apr 2010
    Posts
    20

    Thanks for your response Please review my question

    Thanks everyone for reply back to me
    But non of this works

    what a actually want to do

    is to list all orders that were sent out this month as well as all
    orders that were sent out in this month from exactly one year ago

  5. #5
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Without seeing your schema, I can't provide a runable example. This (acronym deleted) will do what you've requested, although it is distinctly sub-optimal.
    Code:
    SELECT *
       FROM doohicky
       WHERE DateDiff(m, b, '2010-04-30 23:59:59.997') IN (0, 12)
    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  6. #6
    Join Date
    Apr 2010
    Posts
    20

    Okey I have attached a screen shot of the schema

    Much apreciated for reply , i have posted the schema
    please if you don't mind take al look on this
    Attached Thumbnails Attached Thumbnails Image.bmp  

Posting Permissions

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