www.webdeveloper.com
Results 1 to 5 of 5

Thread: ASP code for Month & year Report.

  1. #1
    Join Date
    Apr 2005
    Posts
    16

    ASP code for Month & year Report.

    I am using ASP and MS Access.
    **************************************************************************************************** ***********
    strsql = "select * from domestic where city='" & city & "' and Date between '" & month1/01/year1 & "' and '" & month1/31/year1 & "'"

    **************************************************************************************************** ***********

    I want to view the Report of particular city,month and year.
    If I select the city=Bangalore,month=May,Year=2005,Then It shows the Detail Report for the above query.
    But I am getting same answer( Detail Report) for selecting any month and year.

    Please give me the code for this.



    Thank You.

  2. #2
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    5,298
    Should be more like this:
    Code:
    strsql = "select * from domestic where city='" & city & "' and Date between #" & month1 & "/01/" & year1 & "# and #" & month1 & "/31/" & year1 & "#;"
    Note, it can be risky to name a field "Date" as it is a reserver word and may cause problems.

    Regards.

  3. #3
    Join Date
    Dec 2004
    Posts
    8,637
    Just surround your table names and column names with square brackets to avoid getting them confused with SQL syntax keywords and functions.

  4. #4
    Join Date
    Apr 2005
    Posts
    16

    ASP code

    Dear Sir/Madam,


    Thank you for replying,
    but it gives the same output(If I choose any year or any month,it gives the same Report).

  5. #5
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    5,298
    Is Date a column in your table?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles