Re: Times
cfset myTimeString='4PM' cfoutput#hour(variables.myTimeString)#/cfoutput Candace Cottrell wrote: Is there an easy way to convert 4PM to 1600 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Times
i'm pretty sure you can do cfset the_time= 01/01/2004 4:00 PM cfset the_time = TimeFormat(the_time,HH:mm) HH gives 24 hour clock -Original Message- From: Candace Cottrell [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 3:01 PM To: CF-Talk Subject: Times Is there an easy way to convert 4PM to 1600 Is regular expressions the way to go on this one? I am so sick of dates and timeslol Candace K. Cottrell, Web Developer The Children's Medical Center One Children's Plaza Dayton, OH 45404 937-641-4293 http://www.childrensdayton.org [EMAIL PROTECTED] There is no right price for the wrong product, even if it is inexpensive and delivered on time. _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Times
Timeformat() should be able to do it.Convert 4:30pm to 1630 etc.Or 4pm to 1600. http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/funca107.htm#wp50 30792 John Burns -Original Message- From: Candace Cottrell [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 3:01 PM To: CF-Talk Subject: Times Is there an easy way to convert 4PM to 1600 Is regular expressions the way to go on this one? I am so sick of dates and timeslol Candace K. Cottrell, Web Developer The Children's Medical Center One Children's Plaza Dayton, OH 45404 937-641-4293 http://www.childrensdayton.org [EMAIL PROTECTED] There is no right price for the wrong product, even if it is inexpensive and delivered on time. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Times
Thanks guys I ended up using a combination of all of them :) Candace K. Cottrell, Web Developer The Children's Medical Center One Children's Plaza Dayton, OH 45404 937-641-4293 http://www.childrensdayton.org [EMAIL PROTECTED] There is no right price for the wrong product, even if it is inexpensive and delivered on time. [EMAIL PROTECTED] 3/8/2004 3:07:53 PM Timeformat() should be able to do it.Convert 4:30pm to 1630 etc.Or 4pm to 1600. http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/funca107.htm#wp50 30792 John Burns -Original Message- From: Candace Cottrell [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 3:01 PM To: CF-Talk Subject: Times Is there an easy way to convert 4PM to 1600 Is regular expressions the way to go on this one? I am so sick of dates and timeslol Candace K. Cottrell, Web Developer The Children's Medical Center One Children's Plaza Dayton, OH 45404 937-641-4293 http://www.childrensdayton.org [EMAIL PROTECTED] There is no right price for the wrong product, even if it is inexpensive and delivered on time. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Times Return Wrong
check your time zone settings on the machine running CFMX ? - Original Message - From: Tyler Clendenin [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 12:15 PM Subject: Times Return Wrong I am using Cold Fusion MX and connecting to an informix database through an odbc source. The problem is that all times being reutrned from the queries are actually three hours greater then what is in the database. Anyone know what this could be. I am guessing some sort of weird time zone compatiblity attept gone horribly wrong. thanky -tyler clendenin gsl solutions ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
Re: Times Return Wrong
Tyler Clendenin wrote: I am using Cold Fusion MX and connecting to an informix database through an odbc source. The problem is that all times being reutrned from the queries are actually three hours greater then what is in the database. Anyone know what this could be. I am guessing some sort of weird time zone compatiblity attept gone horribly wrong. What datatypes? TIMESTAMP WITH TIMEZONE or just TIMESTAMP? What timezone is the server running at? Jochem ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.
Re: Times Return Wrong
They are datetime fields, i guess in informix it is just called date. and the servers are actually accross the street from one another. - Original Message - From: Jochem van Dieten [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 12:38 PM Subject: Re: Times Return Wrong Tyler Clendenin wrote: I am using Cold Fusion MX and connecting to an informix database through an odbc source. The problem is that all times being reutrned from the queries are actually three hours greater then what is in the database. Anyone know what this could be. I am guessing some sort of weird time zone compatiblity attept gone horribly wrong. What datatypes? TIMESTAMP WITH TIMEZONE or just TIMESTAMP? What timezone is the server running at? Jochem ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
Re: Times...
No workie :( Neil - Original Message - From: Don Vawter [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 9:52 PM Subject: Re: Times... it is a stored function not a stored procedure should work ins sql 7 - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 6:49 PM Subject: Re: Times... Server: Msg 170, Level 15, State 1, Line 1 Line 1: Incorrect syntax near 'FUNCTION'. Server: Msg 137, Level 15, State 1, Line 9 Must declare the variable '@dt'. Server: Msg 137, Level 15, State 1, Line 10 Must declare the variable '@interval'. Server: Msg 137, Level 15, State 1, Line 11 Must declare the variable '@interval'. Server: Msg 178, Level 15, State 1, Line 13 A RETURN statement with a return status can only be used in a stored procedure. Any ideas? I don't know what the problem is? THanks, Neil - Original Message - From: Don Vawter [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 8:22 PM Subject: Re: Times... Thanks, now if I could just find a job. - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 5:29 PM Subject: Re: Times... You are the man! thanks! Neil - Original Message - From: Don Vawter [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 6:54 PM Subject: Re: Times... I have a function that groups date time information by an interval of time(in minutes). The function is : udf_interval_format(@dt datetime,@interval int) so if you wanted to count the number of rows in an interval you would use: select utility.dbo.udf_interval_format(yourdatetimefield,2) as yourint,count(*) as ct from yourtable group by utility.dbo.udf_interval_format(yourdatetimefield,2) order by utility.dbo.udf_interval_format(yourdatetimefield,2) which would group data every 2 mins. the output of the function is hh:mm Here is the function CREATE FUNCTION udf_interval_format(@dt datetime,@interval int) RETURNS varchar(5) AS BEGIN DECLARE @pieces int DECLARE @st varchar(5) DECLARE @hourpart int DECLARE @minpart int set @pieces = (60*datepart(hour,@dt) +datepart(mi,@dt) )/@interval set @hourpart= @pieces*@interval/60 set @minpart =@pieces*@interval - @hourpart*60 set @st= right('00'+cast(@hourpart as varchar),2)+':'+right('00'+cast(@minpart as varchar),2) return @st END - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 3:54 PM Subject: Times... Here is a SQL question for yall... I have about 3000 rows a day which have a datetime column. I want to be able to graph the number of rows every 2 minutes. I know it could be done with a lot of looping in CF but what is the best way to tackle this one? Thanks, Neil __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Times...
Can you use stored functions in SQL 7. From what I can see it doesn't like that format (or something!) Thanks, Neil - Original Message - From: Don Vawter [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 9:52 PM Subject: Re: Times... it is a stored function not a stored procedure should work ins sql 7 - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 6:49 PM Subject: Re: Times... Server: Msg 170, Level 15, State 1, Line 1 Line 1: Incorrect syntax near 'FUNCTION'. Server: Msg 137, Level 15, State 1, Line 9 Must declare the variable '@dt'. Server: Msg 137, Level 15, State 1, Line 10 Must declare the variable '@interval'. Server: Msg 137, Level 15, State 1, Line 11 Must declare the variable '@interval'. Server: Msg 178, Level 15, State 1, Line 13 A RETURN statement with a return status can only be used in a stored procedure. Any ideas? I don't know what the problem is? THanks, Neil - Original Message - From: Don Vawter [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 8:22 PM Subject: Re: Times... Thanks, now if I could just find a job. - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 5:29 PM Subject: Re: Times... You are the man! thanks! Neil - Original Message - From: Don Vawter [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 6:54 PM Subject: Re: Times... I have a function that groups date time information by an interval of time(in minutes). The function is : udf_interval_format(@dt datetime,@interval int) so if you wanted to count the number of rows in an interval you would use: select utility.dbo.udf_interval_format(yourdatetimefield,2) as yourint,count(*) as ct from yourtable group by utility.dbo.udf_interval_format(yourdatetimefield,2) order by utility.dbo.udf_interval_format(yourdatetimefield,2) which would group data every 2 mins. the output of the function is hh:mm Here is the function CREATE FUNCTION udf_interval_format(@dt datetime,@interval int) RETURNS varchar(5) AS BEGIN DECLARE @pieces int DECLARE @st varchar(5) DECLARE @hourpart int DECLARE @minpart int set @pieces = (60*datepart(hour,@dt) +datepart(mi,@dt) )/@interval set @hourpart= @pieces*@interval/60 set @minpart =@pieces*@interval - @hourpart*60 set @st= right('00'+cast(@hourpart as varchar),2)+':'+right('00'+cast(@minpart as varchar),2) return @st END - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 3:54 PM Subject: Times... Here is a SQL question for yall... I have about 3000 rows a day which have a datetime column. I want to be able to graph the number of rows every 2 minutes. I know it could be done with a lot of looping in CF but what is the best way to tackle this one? Thanks, Neil __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Times...
Tried it on my SQL 2k box and it took the function. Now I just need to move the data :) Neil - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Sunday, January 13, 2002 1:35 AM Subject: Re: Times... Can you use stored functions in SQL 7. From what I can see it doesn't like that format (or something!) Thanks, Neil - Original Message - From: Don Vawter [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 9:52 PM Subject: Re: Times... it is a stored function not a stored procedure should work ins sql 7 - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 6:49 PM Subject: Re: Times... Server: Msg 170, Level 15, State 1, Line 1 Line 1: Incorrect syntax near 'FUNCTION'. Server: Msg 137, Level 15, State 1, Line 9 Must declare the variable '@dt'. Server: Msg 137, Level 15, State 1, Line 10 Must declare the variable '@interval'. Server: Msg 137, Level 15, State 1, Line 11 Must declare the variable '@interval'. Server: Msg 178, Level 15, State 1, Line 13 A RETURN statement with a return status can only be used in a stored procedure. Any ideas? I don't know what the problem is? THanks, Neil - Original Message - From: Don Vawter [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 8:22 PM Subject: Re: Times... Thanks, now if I could just find a job. - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 5:29 PM Subject: Re: Times... You are the man! thanks! Neil - Original Message - From: Don Vawter [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 6:54 PM Subject: Re: Times... I have a function that groups date time information by an interval of time(in minutes). The function is : udf_interval_format(@dt datetime,@interval int) so if you wanted to count the number of rows in an interval you would use: select utility.dbo.udf_interval_format(yourdatetimefield,2) as yourint,count(*) as ct from yourtable group by utility.dbo.udf_interval_format(yourdatetimefield,2) order by utility.dbo.udf_interval_format(yourdatetimefield,2) which would group data every 2 mins. the output of the function is hh:mm Here is the function CREATE FUNCTION udf_interval_format(@dt datetime,@interval int) RETURNS varchar(5) AS BEGIN DECLARE @pieces int DECLARE @st varchar(5) DECLARE @hourpart int DECLARE @minpart int set @pieces = (60*datepart(hour,@dt) +datepart(mi,@dt) )/@interval set @hourpart= @pieces*@interval/60 set @minpart =@pieces*@interval - @hourpart*60 set @st= right('00'+cast(@hourpart as varchar),2)+':'+right('00'+cast(@minpart as varchar),2) return @st END - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 3:54 PM Subject: Times... Here is a SQL question for yall... I have about 3000 rows a day which have a datetime column. I want to be able to graph the number of rows every 2 minutes. I know it could be done with a lot of looping in CF but what is the best way to tackle this one? Thanks, Neil __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Times...
What db? - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 3:54 PM Subject: Times... Here is a SQL question for yall... I have about 3000 rows a day which have a datetime column. I want to be able to graph the number of rows every 2 minutes. I know it could be done with a lot of looping in CF but what is the best way to tackle this one? Thanks, Neil __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Times...
SQL server sorry :) Neil - Original Message - From: Don Vawter [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 5:58 PM Subject: Re: Times... What db? - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 3:54 PM Subject: Times... Here is a SQL question for yall... I have about 3000 rows a day which have a datetime column. I want to be able to graph the number of rows every 2 minutes. I know it could be done with a lot of looping in CF but what is the best way to tackle this one? Thanks, Neil __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Times...
I have a function that groups date time information by an interval of time(in minutes). The function is : udf_interval_format(@dt datetime,@interval int) so if you wanted to count the number of rows in an interval you would use: select utility.dbo.udf_interval_format(yourdatetimefield,2) as yourint,count(*) as ct from yourtable group by utility.dbo.udf_interval_format(yourdatetimefield,2) order by utility.dbo.udf_interval_format(yourdatetimefield,2) which would group data every 2 mins. the output of the function is hh:mm Here is the function CREATE FUNCTION udf_interval_format(@dt datetime,@interval int) RETURNS varchar(5) AS BEGIN DECLARE @pieces int DECLARE @st varchar(5) DECLARE @hourpart int DECLARE @minpart int set @pieces = (60*datepart(hour,@dt)+datepart(mi,@dt) )/@interval set @hourpart= @pieces*@interval/60 set @minpart =@pieces*@interval - @hourpart*60 set @st= right('00'+cast(@hourpart as varchar),2)+':'+right('00'+cast(@minpart as varchar),2) return @st END - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 3:54 PM Subject: Times... Here is a SQL question for yall... I have about 3000 rows a day which have a datetime column. I want to be able to graph the number of rows every 2 minutes. I know it could be done with a lot of looping in CF but what is the best way to tackle this one? Thanks, Neil __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Times...
You are the man! thanks! Neil - Original Message - From: Don Vawter [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 6:54 PM Subject: Re: Times... I have a function that groups date time information by an interval of time(in minutes). The function is : udf_interval_format(@dt datetime,@interval int) so if you wanted to count the number of rows in an interval you would use: select utility.dbo.udf_interval_format(yourdatetimefield,2) as yourint,count(*) as ct from yourtable group by utility.dbo.udf_interval_format(yourdatetimefield,2) order by utility.dbo.udf_interval_format(yourdatetimefield,2) which would group data every 2 mins. the output of the function is hh:mm Here is the function CREATE FUNCTION udf_interval_format(@dt datetime,@interval int) RETURNS varchar(5) AS BEGIN DECLARE @pieces int DECLARE @st varchar(5) DECLARE @hourpart int DECLARE @minpart int set @pieces = (60*datepart(hour,@dt)+datepart(mi,@dt) )/@interval set @hourpart= @pieces*@interval/60 set @minpart =@pieces*@interval - @hourpart*60 set @st= right('00'+cast(@hourpart as varchar),2)+':'+right('00'+cast(@minpart as varchar),2) return @st END - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 3:54 PM Subject: Times... Here is a SQL question for yall... I have about 3000 rows a day which have a datetime column. I want to be able to graph the number of rows every 2 minutes. I know it could be done with a lot of looping in CF but what is the best way to tackle this one? Thanks, Neil __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Times...
Thanks, now if I could just find a job. - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 5:29 PM Subject: Re: Times... You are the man! thanks! Neil - Original Message - From: Don Vawter [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 6:54 PM Subject: Re: Times... I have a function that groups date time information by an interval of time(in minutes). The function is : udf_interval_format(@dt datetime,@interval int) so if you wanted to count the number of rows in an interval you would use: select utility.dbo.udf_interval_format(yourdatetimefield,2) as yourint,count(*) as ct from yourtable group by utility.dbo.udf_interval_format(yourdatetimefield,2) order by utility.dbo.udf_interval_format(yourdatetimefield,2) which would group data every 2 mins. the output of the function is hh:mm Here is the function CREATE FUNCTION udf_interval_format(@dt datetime,@interval int) RETURNS varchar(5) AS BEGIN DECLARE @pieces int DECLARE @st varchar(5) DECLARE @hourpart int DECLARE @minpart int set @pieces = (60*datepart(hour,@dt)+datepart(mi,@dt) )/@interval set @hourpart= @pieces*@interval/60 set @minpart =@pieces*@interval - @hourpart*60 set @st= right('00'+cast(@hourpart as varchar),2)+':'+right('00'+cast(@minpart as varchar),2) return @st END - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 3:54 PM Subject: Times... Here is a SQL question for yall... I have about 3000 rows a day which have a datetime column. I want to be able to graph the number of rows every 2 minutes. I know it could be done with a lot of looping in CF but what is the best way to tackle this one? Thanks, Neil __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Times...
Server: Msg 170, Level 15, State 1, Line 1 Line 1: Incorrect syntax near 'FUNCTION'. Server: Msg 137, Level 15, State 1, Line 9 Must declare the variable '@dt'. Server: Msg 137, Level 15, State 1, Line 10 Must declare the variable '@interval'. Server: Msg 137, Level 15, State 1, Line 11 Must declare the variable '@interval'. Server: Msg 178, Level 15, State 1, Line 13 A RETURN statement with a return status can only be used in a stored procedure. Any ideas? I don't know what the problem is? THanks, Neil - Original Message - From: Don Vawter [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 8:22 PM Subject: Re: Times... Thanks, now if I could just find a job. - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 5:29 PM Subject: Re: Times... You are the man! thanks! Neil - Original Message - From: Don Vawter [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 6:54 PM Subject: Re: Times... I have a function that groups date time information by an interval of time(in minutes). The function is : udf_interval_format(@dt datetime,@interval int) so if you wanted to count the number of rows in an interval you would use: select utility.dbo.udf_interval_format(yourdatetimefield,2) as yourint,count(*) as ct from yourtable group by utility.dbo.udf_interval_format(yourdatetimefield,2) order by utility.dbo.udf_interval_format(yourdatetimefield,2) which would group data every 2 mins. the output of the function is hh:mm Here is the function CREATE FUNCTION udf_interval_format(@dt datetime,@interval int) RETURNS varchar(5) AS BEGIN DECLARE @pieces int DECLARE @st varchar(5) DECLARE @hourpart int DECLARE @minpart int set @pieces = (60*datepart(hour,@dt)+datepart(mi,@dt) )/@interval set @hourpart= @pieces*@interval/60 set @minpart =@pieces*@interval - @hourpart*60 set @st= right('00'+cast(@hourpart as varchar),2)+':'+right('00'+cast(@minpart as varchar),2) return @st END - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 3:54 PM Subject: Times... Here is a SQL question for yall... I have about 3000 rows a day which have a datetime column. I want to be able to graph the number of rows every 2 minutes. I know it could be done with a lot of looping in CF but what is the best way to tackle this one? Thanks, Neil __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Times...
My fault, I am using SQL 7.0 :( Neil - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 8:49 PM Subject: Re: Times... Server: Msg 170, Level 15, State 1, Line 1 Line 1: Incorrect syntax near 'FUNCTION'. Server: Msg 137, Level 15, State 1, Line 9 Must declare the variable '@dt'. Server: Msg 137, Level 15, State 1, Line 10 Must declare the variable '@interval'. Server: Msg 137, Level 15, State 1, Line 11 Must declare the variable '@interval'. Server: Msg 178, Level 15, State 1, Line 13 A RETURN statement with a return status can only be used in a stored procedure. Any ideas? I don't know what the problem is? THanks, Neil - Original Message - From: Don Vawter [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 8:22 PM Subject: Re: Times... Thanks, now if I could just find a job. - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 5:29 PM Subject: Re: Times... You are the man! thanks! Neil - Original Message - From: Don Vawter [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 6:54 PM Subject: Re: Times... I have a function that groups date time information by an interval of time(in minutes). The function is : udf_interval_format(@dt datetime,@interval int) so if you wanted to count the number of rows in an interval you would use: select utility.dbo.udf_interval_format(yourdatetimefield,2) as yourint,count(*) as ct from yourtable group by utility.dbo.udf_interval_format(yourdatetimefield,2) order by utility.dbo.udf_interval_format(yourdatetimefield,2) which would group data every 2 mins. the output of the function is hh:mm Here is the function CREATE FUNCTION udf_interval_format(@dt datetime,@interval int) RETURNS varchar(5) AS BEGIN DECLARE @pieces int DECLARE @st varchar(5) DECLARE @hourpart int DECLARE @minpart int set @pieces = (60*datepart(hour,@dt) +datepart(mi,@dt) )/@interval set @hourpart= @pieces*@interval/60 set @minpart =@pieces*@interval - @hourpart*60 set @st= right('00'+cast(@hourpart as varchar),2)+':'+right('00'+cast(@minpart as varchar),2) return @st END - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 3:54 PM Subject: Times... Here is a SQL question for yall... I have about 3000 rows a day which have a datetime column. I want to be able to graph the number of rows every 2 minutes. I know it could be done with a lot of looping in CF but what is the best way to tackle this one? Thanks, Neil __ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Times...
it is a stored function not a stored procedure should work ins sql 7 - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 6:49 PM Subject: Re: Times... Server: Msg 170, Level 15, State 1, Line 1 Line 1: Incorrect syntax near 'FUNCTION'. Server: Msg 137, Level 15, State 1, Line 9 Must declare the variable '@dt'. Server: Msg 137, Level 15, State 1, Line 10 Must declare the variable '@interval'. Server: Msg 137, Level 15, State 1, Line 11 Must declare the variable '@interval'. Server: Msg 178, Level 15, State 1, Line 13 A RETURN statement with a return status can only be used in a stored procedure. Any ideas? I don't know what the problem is? THanks, Neil - Original Message - From: Don Vawter [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 8:22 PM Subject: Re: Times... Thanks, now if I could just find a job. - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 5:29 PM Subject: Re: Times... You are the man! thanks! Neil - Original Message - From: Don Vawter [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 6:54 PM Subject: Re: Times... I have a function that groups date time information by an interval of time(in minutes). The function is : udf_interval_format(@dt datetime,@interval int) so if you wanted to count the number of rows in an interval you would use: select utility.dbo.udf_interval_format(yourdatetimefield,2) as yourint,count(*) as ct from yourtable group by utility.dbo.udf_interval_format(yourdatetimefield,2) order by utility.dbo.udf_interval_format(yourdatetimefield,2) which would group data every 2 mins. the output of the function is hh:mm Here is the function CREATE FUNCTION udf_interval_format(@dt datetime,@interval int) RETURNS varchar(5) AS BEGIN DECLARE @pieces int DECLARE @st varchar(5) DECLARE @hourpart int DECLARE @minpart int set @pieces = (60*datepart(hour,@dt) +datepart(mi,@dt) )/@interval set @hourpart= @pieces*@interval/60 set @minpart =@pieces*@interval - @hourpart*60 set @st= right('00'+cast(@hourpart as varchar),2)+':'+right('00'+cast(@minpart as varchar),2) return @st END - Original Message - From: Neil H. [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, January 11, 2002 3:54 PM Subject: Times... Here is a SQL question for yall... I have about 3000 rows a day which have a datetime column. I want to be able to graph the number of rows every 2 minutes. I know it could be done with a lot of looping in CF but what is the best way to tackle this one? Thanks, Neil __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists