Using PI and ArcCos in SQL line

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kliq316
    New Member
    • May 2009
    • 5

    Using PI and ArcCos in SQL line

    Hi folks,
    I'm really stumped and need help .. on my ASP page, I'm running a line of SQL that has a calculation in it. In this calculation, I use PI and ARCCOS functions.

    As my database is in Access, I have a module that has these functions detailed, but when I go to run the ASP page, it doesn't recognise these functions.

    What can I do to get around this problem? Sorry if this is an obvious one, but i'm a newbie so please forgive me :o)
  • GazMathias
    Recognized Expert New Member
    • Oct 2008
    • 228

    #2
    One way would be to build a generic query object in the Access database, which can see your functions, and call that in your page, limiting its results.

    "SELECT * FROM qrySomeQuery WHERE something = somethingelse"

    Or you could import your functions across.

    Gaz.

    Comment

    • kliq316
      New Member
      • May 2009
      • 5

      #3
      Hey, I tried importing the functions in, but I'm not sure that I did it right (I just pasted the functions in from the module and referenced them in the sql query, but it still didn't recognise it)?

      Comment

      • GazMathias
        Recognized Expert New Member
        • Oct 2008
        • 228

        #4
        Originally posted by kliq316
        Hey, I tried importing the functions in, but I'm not sure that I did it right (I just pasted the functions in from the module and referenced them in the sql query, but it still didn't recognise it)?
        Have you tried the first approach?

        Gaz.

        Comment

        • kliq316
          New Member
          • May 2009
          • 5

          #5
          Yeah, it didn't work .. it still didn't recognise the functions when accessing the page.

          Comment

          • GazMathias
            Recognized Expert New Member
            • Oct 2008
            • 228

            #6
            Oh well, I guess you'll have to do the work on the recordset then!

            Gaz.

            Comment

            • kliq316
              New Member
              • May 2009
              • 5

              #7
              There's no work to be done on the recordset. Don't worry about it, I'll figure it out.

              Comment

              • GazMathias
                Recognized Expert New Member
                • Oct 2008
                • 228

                #8
                I think you miss understand me.

                Instead of doing:

                Code:
                SELECT somefield, myfunction(someotherfield) As something FROM sometable
                You do:

                Code:
                SELECT somefield, someotherfield FROM table
                ...
                Response.Write myfunction(rs("someotherfield"))
                Make sense?

                Comment

                Working...