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

CFC Errror -Date

Participant ,
May 12, 2009 May 12, 2009

Copy link to clipboard

Copied

Error:

The argument ENDDATE passed to function get() is not of type date.If the component name is specified as a type of this argument, the reason for this error might be that a definition file for such component cannot be found or is not accessible. The specific sequence of files included or processed is: C:\Inetpub\wwwroot\Denemeler\Test\connector_test.cfm, line: 11

Any help is appreciated...

<cfcomponent>
<cffunction name="get"  returntype="query">
<cfargument name="DSN" required="true" type="string">
<cfargument name="startDate" required="true" type="date">
<cfargument name="endDate" required="true" type="date">

<cfargument name="qOper" required="true" type="query">
<cfargument name="config" type="array" required="true" hint="Can lists of lists values">


<cfquery name="getCSAT" datasource="#arguments.DSN#">
    SELECT EMPLOYEE_ID, 0 AS Invalid,
    SUM(DTV_SALES)  AS Value
    FROM OPS$SCA_METRIC_SCORE
    WHERE SCORE_DATE between '#DateFormat(arguments.startdate, "dd-mmm-yy")#'
    AND '#DateFormat(arguments.EndDate, "dd-mmm-yy")#'
    AND  EMPLOYEE_ID IN (<cfqueryparam value="#ValueList(arguments.qOper.EID)#" cfsqltype="CF_SQL_VARCHAR" list="Yes">)
    GROUP BY EMPLOYEE_ID
</cfquery>
<cfreturn getCSAT>
</cffunction>
</cfcomponent>

----

<cfscript>
CCConf    = structnew();
CCConf.MyConnector = "orct1";
CCConf.Method = "get";
CCConf.DSN   = application.Orc; //Oracle DSN
CCConf.Sql   = application.Sql; //SQL 05 DSN
CCConf.startDate = "04/01/2009";
CCConf.endDate  = "04/31/2009";
CCConf.Config = arraynew(1);
</cfscript>

TOPICS
Advanced techniques

Views

607

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

correct answers 1 Correct answer

Valorous Hero , May 12, 2009 May 12, 2009

APRIL DOES NOT HAVE 31 DAYS!

4/31/2009 (or any year) is an illegal date and can NOT be converted into a date variable by any code!

Votes

Translate

Translate
Valorous Hero ,
May 12, 2009 May 12, 2009

Copy link to clipboard

Copied

emmim44 wrote:

CCConf.startDate = "04/01/2009";
CCConf.endDate  = "04/31/2009";

Technically '04/01/2009' and '04/31/2009' are not dates, they are strings that humans can read as dates.  ColdFusion will do it's best to try and convert strings like these into dates.  Sometimes it has trouble - like when some string tries to tell it the forth month, April, has 31 days.

You may want to investigate something like createData() that more explicity tells CF how to create a date out of values.

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
Participant ,
May 12, 2009 May 12, 2009

Copy link to clipboard

Copied

I am trying to odbcdate doesnt work... same error. pls guide me.

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
Valorous Hero ,
May 12, 2009 May 12, 2009

Copy link to clipboard

Copied

APRIL DOES NOT HAVE 31 DAYS!

4/31/2009 (or any year) is an illegal date and can NOT be converted into a date variable by any code!

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
Participant ,
May 12, 2009 May 12, 2009

Copy link to clipboard

Copied

LATEST

Thank u vm

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