Results 1 to 4 of 4
  1. #1
    Join Date
    May 2002
    Location
    USA
    Posts
    9

    Question Unanswered: Help with Query and Module

    I have a module which contains a function returnDate() which returns a value of Date datatype after formatting.This value needs to be set as a criteria for a query.How do i do this.Please help me.The module name is addNewRec.
    Thanks
    Krish

  2. #2
    Join Date
    Aug 2002
    Location
    Québec, Canada
    Posts
    109
    Declare your function as PUBLIC and call it in your SQL statement like any others:

    Code:
    SELECT returnDate([datefield]) AS Expr1, Field2
    FROM Table1;
    You can use the function in the WHERE clause also

  3. #3
    Join Date
    May 2002
    Location
    USA
    Posts
    9
    How do i use it in the WHERE Clause???
    Thanks
    Krish
    Originally posted by JefB
    Declare your function as PUBLIC and call it in your SQL statement like any others:

    Code:
    SELECT returnDate([datefield]) AS Expr1, Field2
    FROM Table1;
    You can use the function in the WHERE clause also

  4. #4
    Join Date
    Aug 2002
    Location
    Québec, Canada
    Posts
    109
    Exactly the same way, it is a plain function that is return a value, you can use it absolutely everywhere you use a VALUE: SELECT, WHERE, HAVING, IIF(), FORMAT(), ...:

    Code:
    SELECT Field2
    FROM Table1 WHERE returnDate([datefield1]) <= returnDate([datefield2]) ;
    JeffB

Posting Permissions

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