Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. custom query

custom query

Scheduled Pinned Locked Moved Database
databasexmlhelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sujithkumarsl
    wrote on last edited by
    #1

    hi i have a table with following schema

    MsgID SystemID Msg Date(YYYY-MM-DD)
    1 1 "" 2009/01/02
    2 1 "" 2009/04/03
    3 1 "" 2009/05/02
    4 2 "" 2009/01/01

    I want to identify the SystemIDs which has messages (column : Msg) generated with a Time difference greater than 3 months In the given table its systemID "1" . ( logged first message on 2009/01/02 and after 3 months 2009/04/03). please help to get a proper query

    My small attempt...

    M 1 Reply Last reply
    0
    • S sujithkumarsl

      hi i have a table with following schema

      MsgID SystemID Msg Date(YYYY-MM-DD)
      1 1 "" 2009/01/02
      2 1 "" 2009/04/03
      3 1 "" 2009/05/02
      4 2 "" 2009/01/01

      I want to identify the SystemIDs which has messages (column : Msg) generated with a Time difference greater than 3 months In the given table its systemID "1" . ( logged first message on 2009/01/02 and after 3 months 2009/04/03). please help to get a proper query

      My small attempt...

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      And what have you tried so far, or are you expecting someone to write the query for you. Some hints. Select top #n datetime dateadd datediff row_number() partition over

      Never underestimate the power of human stupidity RAH

      L 1 Reply Last reply
      0
      • M Mycroft Holmes

        And what have you tried so far, or are you expecting someone to write the query for you. Some hints. Select top #n datetime dateadd datediff row_number() partition over

        Never underestimate the power of human stupidity RAH

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        don't understand. plz send codez ASAP to lazy@yahoo.in :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups