|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Creating TimeSpan
Any one got any idea how I can create this variable
<cfset CachePeriod = CreateTimeSpan(CacheQuery.property)> I always get the error: " The function takes 4 parameters." Cheers |
|
#2
|
|||
|
|||
|
it's as follows
CreateTimeSpan(days, hours, minutes, seconds) so it will be something like CreateTimeSpan(0, 0, 0, CacheQuery.property) hope it helps |
|
#3
|
|||
|
|||
|
createTimeSpan takes four arguments. You could try creating a string and feeding that into the function call:
<cfset theTimeSpan = "0,0,20,0" /> <cfset CachePeriod = CreateTimeSpan( theTimeSpan )>
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#4
|
|||
|
|||
|
Cheers Kiteless: I had actually tried that before, though. It threw the same error.
I gave up and found another method - but for future reference: there's now way to tell CF to resolve a variable before another, is there? Cheers |
|
#5
|
|||
|
|||
|
I would just set the variable equal to the actual timespan that createTimeSpan returns, like this:
<cfset theTimeSpan = createTimeSpan( '0,0,20,0' ) /> <cfquery cachedWithin="#theTimeSpan#"...> |
|
#6
|
|||
|
|||
|
Thanks, I didn't realise you could do that - I'll give it a go
![]() |
|
#7
|
|||
|
|||
|
Actuall I just tried implementing that and I got the same error message :s
|
|
#8
|
|||
|
|||
|
<cfquery cachedWithin="Evaluate(#theTimeSpan#)"...>
will this help? |
|
#9
|
|||
|
|||
|
<cfset theTimeSpan = createTimeSpan(0,0,20,0)>
<cfquery cachedwithin="#theTimeSpan#"...> I appologise: it did work only kiteless put ( '0,0,20,0' ) it wanted (0,0,20,0) Thanks all |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Creating TimeSpan |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|