Question
CFC return type question
Does the return type date only handle the 'date' and not the
date & time????
Because it doesn't appear to be returning the time portion to be input into
our database.....
<cffunction name="calcDate" access="public" returntype="date"
> hint="Returns 1st Saturday of Month">
> <cfargument name="id" type="numeric" required="yes">
> <cfset var GetTournDate = "">
> <cfset var tourndate = "">
> <cfset var FirstOfMonth2MonthsAhead = "">
> <cfset NewTournDate = "">
> <cfquery name="GetTournDate" datasource="SalleBoise">
> select TournDateTime
> from clubtournaments
> where TournID=<cfqueryparam cfsqltype="cf_sql_integer"
> value="#arguments.id#">
> </cfquery>
> <cfset tourndate = GetTournDate.TournDateTime>
> <cfset FirstOfMonth2MonthsAhead = createdatetime(year(dateadd('m', 2,
> tourndate)), month(dateadd('m', 2, tourndate)), 01, hour(tourndate),
> minute(tourndate), second(tourndate))>
> <cfset NewTournDate = dateadd('d',
> 7-dayofweek(FirstOfMonth2MonthsAhead), FirstOfMonth2MonthsAhead)>
> <cfreturn NewTournDate />
> </cffunction>
Because it doesn't appear to be returning the time portion to be input into
our database.....
<cffunction name="calcDate" access="public" returntype="date"
> hint="Returns 1st Saturday of Month">
> <cfargument name="id" type="numeric" required="yes">
> <cfset var GetTournDate = "">
> <cfset var tourndate = "">
> <cfset var FirstOfMonth2MonthsAhead = "">
> <cfset NewTournDate = "">
> <cfquery name="GetTournDate" datasource="SalleBoise">
> select TournDateTime
> from clubtournaments
> where TournID=<cfqueryparam cfsqltype="cf_sql_integer"
> value="#arguments.id#">
> </cfquery>
> <cfset tourndate = GetTournDate.TournDateTime>
> <cfset FirstOfMonth2MonthsAhead = createdatetime(year(dateadd('m', 2,
> tourndate)), month(dateadd('m', 2, tourndate)), 01, hour(tourndate),
> minute(tourndate), second(tourndate))>
> <cfset NewTournDate = dateadd('d',
> 7-dayofweek(FirstOfMonth2MonthsAhead), FirstOfMonth2MonthsAhead)>
> <cfreturn NewTournDate />
> </cffunction>