www.webdeveloper.com
Results 1 to 5 of 5

Thread: kindly please check this expression

  1. #1
    Join Date
    Apr 2005
    Location
    Philippines
    Posts
    92

    kindly please check this expression

    good day,

    kindly please check whats the problem with this SQL expression..

    <%

    sYear = request("year")

    OpenDB sConnStats
    sSQL = "SELECT Sum(TopIpsPerDay.Total) AS Ips, Sum(TopPageViewsPerDay.Total) AS Views, Format([TopIpsPerDay].[Date],'m') AS MonthNumber FROM TopIpsPerDay INNER JOIN TopPageViewsPerDay ON TopIpsPerDay.Date = TopPageViewsPerDay.Date GROUP BY Format([TopIpsPerDay].[Date],'m'), Format([topIpsPerDay].[Date],'yyyy') HAVING (((Format([topIpsPerDay].[Date],'yyyy'))="&sYear&"))"

    rs.Open sSQL,,,adCmdTable

    do while not rs.eof
    %>

    im getting this error:

    Microsoft JET Database Engine error '80040e14'

    Extra ) in query expression '(((Format([topIpsPerDay].[Date],'yyyy'))=))'.


    i've been taking this for a day... please help...thanks...
    if theres someone to ask for, dont hesitate...

  2. #2
    Join Date
    Dec 2004
    Location
    Eau Claire, WI
    Posts
    153
    Are you sure that you're passing it the Year? It would appear that your sYear variable is blank.

    I would Try "HAVING Year([topIpsPerDay].[Date]) =" & sYear & "))"

    Let me know if that helps..
    Brad Candell - Owner/Developer
    http://www.EauClaireWEB.com - Web Development

  3. #3
    Join Date
    Sep 2005
    Posts
    4
    If you download MySQLcc you can paste the query into it directly and it should report your error.

    Obviously you would have to replace your variables with values.

  4. #4
    Join Date
    Apr 2005
    Location
    Philippines
    Posts
    92
    Quote Originally Posted by candelbc
    Are you sure that you're passing it the Year? It would appear that your sYear variable is blank.

    I would Try "HAVING Year([topIpsPerDay].[Date]) =" & sYear & "))"

    Let me know if that helps..

    i got same error.. the Extra (...etc...
    if theres someone to ask for, dont hesitate...

  5. #5
    Join Date
    Dec 2004
    Location
    Eau Claire, WI
    Posts
    153
    Instead of executing your SQL code, try doing a

    Response.Write sYear

    It sort of appears from the error above that the Variable contains no data or is Null.
    Brad Candell - Owner/Developer
    http://www.EauClaireWEB.com - Web Development

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