Retrieving data by using live parameters....

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • simhadrisai
    New Member
    • May 2013
    • 3

    Retrieving data by using live parameters....

    I have table name time_data in that it holds (docid,docdate, usertype,fromda te,todate,useri d ) columns date format is 'dd/mm/yyyy' now i want to retrieve the data by giving the run time parameters month and year ...'JUN' and '2013' .....
    for suppose if i give month jan and year 2013 in that jan month it what date i have entered ..has to come ...total sum of users
  • rski
    Recognized Expert Contributor
    • Dec 2006
    • 700

    #2
    not sure if I understand you want to count number of records for given month and year?

    Comment

    • gaurishere
      New Member
      • Sep 2013
      • 9

      #3
      Code:
      select count(*)
      from time_data 
      where to_char(fromdate,'Mon')='&Mon' and to_char(fromdate,'YYYY')='&Year'
      &Mon and &Year will allow u runtime parameter
      like this
      Enter value for mon: Mar
      Enter value for year: 2013

      Hope this query helps u
      Last edited by Rabbit; Oct 3 '13, 03:08 PM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.

      Comment

      Working...