ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 13th, 2005, 08:48 AM
airdesign airdesign is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Location: Oxford, UK
Posts: 93 airdesign User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 12 m 51 sec
Reputation Power: 4
Send a message via MSN to airdesign Send a message via Yahoo to airdesign
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

Reply With Quote
  #2  
Old June 13th, 2005, 09:14 AM
FALCONSEYE FALCONSEYE is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 377 FALCONSEYE Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 1 Day 16 h 57 m 14 sec
Warnings Level: 15
Number of bans: 1
Reputation Power: 0
it's as follows

CreateTimeSpan(days, hours, minutes, seconds)

so it will be something like
CreateTimeSpan(0, 0, 0, CacheQuery.property)

hope it helps

Reply With Quote
  #3  
Old June 13th, 2005, 09:15 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,682 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 15 h 25 m 55 sec
Reputation Power: 53
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

Reply With Quote
  #4  
Old June 13th, 2005, 10:21 AM
airdesign airdesign is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Location: Oxford, UK
Posts: 93 airdesign User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 12 m 51 sec
Reputation Power: 4
Send a message via MSN to airdesign Send a message via Yahoo to airdesign
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

Reply With Quote
  #5  
Old June 13th, 2005, 10:28 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,682 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 15 h 25 m 55 sec
Reputation Power: 53
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#"...>

Reply With Quote
  #6  
Old June 13th, 2005, 10:30 AM
airdesign airdesign is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Location: Oxford, UK
Posts: 93 airdesign User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 12 m 51 sec
Reputation Power: 4
Send a message via MSN to airdesign Send a message via Yahoo to airdesign
Thanks, I didn't realise you could do that - I'll give it a go

Reply With Quote
  #7  
Old June 13th, 2005, 10:31 AM
airdesign airdesign is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Location: Oxford, UK
Posts: 93 airdesign User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 12 m 51 sec
Reputation Power: 4
Send a message via MSN to airdesign Send a message via Yahoo to airdesign
Actuall I just tried implementing that and I got the same error message :s

Reply With Quote
  #8  
Old June 13th, 2005, 10:56 AM
FALCONSEYE FALCONSEYE is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 377 FALCONSEYE Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 1 Day 16 h 57 m 14 sec
Warnings Level: 15
Number of bans: 1
Reputation Power: 0
<cfquery cachedWithin="Evaluate(#theTimeSpan#)"...>

will this help?

Reply With Quote
  #9  
Old June 13th, 2005, 12:07 PM
airdesign airdesign is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Location: Oxford, UK
Posts: 93 airdesign User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 12 m 51 sec
Reputation Power: 4
Send a message via MSN to airdesign Send a message via Yahoo to airdesign
<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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Creating TimeSpan


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT