• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Coldfusion Query With Function Help

Guest
Dec 04, 2012 Dec 04, 2012

Copy link to clipboard

Copied

Hello!  I am using Coldfusion 9 as well as the current version of MySQL.  My current query is throwing an error:

<CFQUERY NAME="getmemgal" DATASOURCE="#ds#">

SELECT usrid, usrmem, usrlogin, usrastro, memid, memlast, memfirst, memend, memlife

FROM usr, mem

WHERE usrmem LIKE memid

AND usrastro LIKE 1

AND ( memlife LIKE 1 OR CreateODBCDate(CreateDate(memend+1,1,15)) > CreateODBCDate(Now()) )

ORDER BY memlast, memfirst

</CFQUERY>

Right now, the database stores the most recent year for which dues are paid as an integer, in "memend".  This query gives the members a 15-day grace period before their member photo gallery stops showing up on the site.  This means that a member who last paid for 2012 will have until January 15, 2013 to pay their dues.  Hence this part of the query:

AND ( memlife LIKE 1 OR CreateODBCDate(CreateDate(memend+1,1,15)) > CreateODBCDate(Now()) )

So you can see that their membership expires on January 15 of the year following the end of the payment.  But, this query is throwing a syntax error.  Can anybody help me correct this?

-Scott

Views

630

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 04, 2012 Dec 04, 2012

Copy link to clipboard

Copied

Specifics, please.  Error message, line number, etc.

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 04, 2012 Dec 04, 2012

Copy link to clipboard

Copied

Error Executing Database Query.

FUNCTION cva_ver_01.CreateODBCDate does not exist

The error occurred in R:\_Web\cva\gallery.cfm: line 1

Called from R:\_Web\cva\Application.cfc: line 21

Called from R:\_Web\cva\gallery.cfm: line 1

Called from R:\_Web\cva\Application.cfc: line 21

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 04, 2012 Dec 04, 2012

Copy link to clipboard

Copied

1. May be in this NOw(), try within # signs.

AND ( memlife LIKE 1 OR CreateODBCDate(CreateDate(memend+1,1,15)) > CreateODBCDate(#Now()#) )

2.

AND ( memlife LIKE 1 OR (CreateODBCDate(CreateDate(memend+1,1,15)) > CreateODBCDate(#Now()#)) )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 05, 2012 Dec 05, 2012

Copy link to clipboard

Copied

LATEST

Actually, he needs octothorps araund every variable. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation