RE: 7 days old

2004-04-09 Thread Tony Weeg
hey dan.

here is what ya want.

CFQUERY NAME=whatsnew DATASOURCE=puhweb
select * FROM whats_new
WHERE dateAdded = dateFormat(dateAdd('d',-7,now()),'mm/dd/')
order by dateAdded DESC
/CFQUERY

hth

tony

r e v o l u t i o n w e b d e s i g n 
[EMAIL PROTECTED]
www.revolutionwebdesign.com

its only looks good to those who can see bad as well
-anonymous

-Original Message-
From: Daniel Kessler [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 09, 2004 12:31 PM
To: CF-Talk
Subject: 7 days old

I'm doing a query for all records that are newer than 7 days.I 
inserted the date using DateFormat(Now()).Unfortunately it gives me 
an error that dateAdded is unidentified.True, it's a column and I 
want it to search the column for anything less than 7 days old.Can 
anyone help me word this WHERE?

CFQUERY NAME=whatsnew DATASOURCE=puhweb
select * FROM whats_new
WHERE '#DateDiff(d,dateAdded,the_date)#'  7
order by dateAdded DESC
/CFQUERY

thanks.

-- 
Daniel Kessler

Department of Public and Community Health
University of Maryland
Suite 2387 Valley Drive
College Park, MD20742-2611
301-405-2545 Phone
www.phi.umd.edu
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: 7 days old

2004-04-09 Thread Tony Weeg
or you could do it all in sql logic like this

CFQUERY NAME=whatsnew DATASOURCE=puhweb
select * FROM whats_new
WHERE dateAdded = DATEADD('d',-7,getDate()) 
order by dateAdded DESC
/CFQUERY

that should work, although im not 100% on the 'd' part, might just need
the d plain, and not in single quotes.

try it either way to see which is right.

later

tony

r e v o l u t i o n w e b d e s i g n 
[EMAIL PROTECTED]
www.revolutionwebdesign.com

its only looks good to those who can see bad as well
-anonymous

-Original Message-
From: Daniel Kessler [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 09, 2004 12:31 PM
To: CF-Talk
Subject: 7 days old

I'm doing a query for all records that are newer than 7 days.I 
inserted the date using DateFormat(Now()).Unfortunately it gives me 
an error that dateAdded is unidentified.True, it's a column and I 
want it to search the column for anything less than 7 days old.Can 
anyone help me word this WHERE?

CFQUERY NAME=whatsnew DATASOURCE=puhweb
select * FROM whats_new
WHERE '#DateDiff(d,dateAdded,the_date)#'  7
order by dateAdded DESC
/CFQUERY

thanks.

-- 
Daniel Kessler

Department of Public and Community Health
University of Maryland
Suite 2387 Valley Drive
College Park, MD20742-2611
301-405-2545 Phone
www.phi.umd.edu
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: 7 days old

2004-04-09 Thread Tony Weeg
oops in the code you will need to surround the dateFormat with the #'s

so it would really look like...

CFQUERY NAME=whatsnew DATASOURCE=puhweb
select * FROM whats_new
WHERE dateAdded =
'#dateFormat(dateAdd('d',-7,now()),'mm/dd/')#'
order by dateAdded DESC
/CFQUERY

tony

r e v o l u t i o n w e b d e s i g n 
[EMAIL PROTECTED]
www.revolutionwebdesign.com

its only looks good to those who can see bad as well
-anonymous

-Original Message-
From: Tony Weeg [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 09, 2004 12:35 PM
To: CF-Talk
Subject: RE: 7 days old

hey dan.

here is what ya want.

CFQUERY NAME=whatsnew DATASOURCE=puhweb
select * FROM whats_new
WHERE dateAdded = dateFormat(dateAdd('d',-7,now()),'mm/dd/')
order by dateAdded DESC
/CFQUERY

hth

tony

r e v o l u t i o n w e b d e s i g n 
[EMAIL PROTECTED]
www.revolutionwebdesign.com

its only looks good to those who can see bad as well
-anonymous

-Original Message-
From: Daniel Kessler [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 09, 2004 12:31 PM
To: CF-Talk
Subject: 7 days old

I'm doing a query for all records that are newer than 7 days.I 
inserted the date using DateFormat(Now()).Unfortunately it gives me 
an error that dateAdded is unidentified.True, it's a column and I 
want it to search the column for anything less than 7 days old.Can 
anyone help me word this WHERE?

CFQUERY NAME=whatsnew DATASOURCE=puhweb
select * FROM whats_new
WHERE '#DateDiff(d,dateAdded,the_date)#'  7
order by dateAdded DESC
/CFQUERY

thanks.

-- 
Daniel Kessler

Department of Public and Community Health
University of Maryland
Suite 2387 Valley Drive
College Park, MD20742-2611
301-405-2545 Phone
www.phi.umd.edu
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: 7 days old

2004-04-09 Thread Jochem van Dieten
Daniel Kessler wrote:

 I'm doing a query for all records that are newer than 7 days.I 
 inserted the date using DateFormat(Now()).Unfortunately it gives me 
 an error that dateAdded is unidentified.True, it's a column and I 
 want it to search the column for anything less than 7 days old.Can 
 anyone help me word this WHERE?
 
 CFQUERY NAME=whatsnew DATASOURCE=puhweb
 select * FROM whats_new
 WHERE '#DateDiff(d,dateAdded,the_date)#'  7
 order by dateAdded DESC
 /CFQUERY

CFQUERY NAME=whatsnew DATASOURCE=puhweb
SELECT *
FROM whats_new
WHERE dateAdded  cfqueryparam cfsqltype=cf_sql_timestamp 
value=#DateAdd(d,-7,Now())#
ORDER BY dateAdded DESC
/CFQUERY

Jochem

-- 
I don't get it
immigrants don't work
and steal our jobs
- Loesje
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: 7 days old

2004-04-09 Thread Charlie Griefer
assuming (yeah, yeah, i know) that dateAdded is a date/time datatype, why
the dateFormat() function?my understanding is that it's more for
formatting output/display (also, if it's a date/time datatype, no single
quotes).

i'd think if anything, you want to throw a createODBCDate() around that.

SELECT *
FROM whats_new
WHERE dateAdded = #createODBCDate(dateAdd('d', -7, now())#

- Original Message - 
From: Tony Weeg [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Friday, April 09, 2004 9:39 AM
Subject: RE: 7 days old

 oops in the code you will need to surround the dateFormat with the #'s

 so it would really look like...


 CFQUERY NAME=whatsnew DATASOURCE=puhweb
 select * FROM whats_new
 WHERE dateAdded =
 '#dateFormat(dateAdd('d',-7,now()),'mm/dd/')#'
 order by dateAdded DESC
 /CFQUERY

 tony

 r e v o l u t i o n w e b d e s i g n
 [EMAIL PROTECTED]
 www.revolutionwebdesign.com

 its only looks good to those who can see bad as well
 -anonymous

 -Original Message-
 From: Tony Weeg [mailto:[EMAIL PROTECTED]
 Sent: Friday, April 09, 2004 12:35 PM
 To: CF-Talk
 Subject: RE: 7 days old


 hey dan.

 here is what ya want.

 CFQUERY NAME=whatsnew DATASOURCE=puhweb
 select * FROM whats_new
 WHERE dateAdded = dateFormat(dateAdd('d',-7,now()),'mm/dd/')
 order by dateAdded DESC
 /CFQUERY

 hth

 tony

 r e v o l u t i o n w e b d e s i g n
 [EMAIL PROTECTED]
 www.revolutionwebdesign.com

 its only looks good to those who can see bad as well
 -anonymous

 -Original Message-
 From: Daniel Kessler [mailto:[EMAIL PROTECTED]
 Sent: Friday, April 09, 2004 12:31 PM
 To: CF-Talk
 Subject: 7 days old


 I'm doing a query for all records that are newer than 7 days.I
 inserted the date using DateFormat(Now()).Unfortunately it gives me
 an error that dateAdded is unidentified.True, it's a column and I
 want it to search the column for anything less than 7 days old.Can
 anyone help me word this WHERE?

 CFQUERY NAME=whatsnew DATASOURCE=puhweb
 select * FROM whats_new
 WHERE '#DateDiff(d,dateAdded,the_date)#'  7
 order by dateAdded DESC
 /CFQUERY

 thanks.

 -- 
 Daniel Kessler

 Department of Public and Community Health
 University of Maryland
 Suite 2387 Valley Drive
 College Park, MD20742-2611
 301-405-2545 Phone
 www.phi.umd.edu






 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: 7 days old

2004-04-09 Thread Tony Weeg
yeah, more than was needed...ur right, my bad.

tony

r e v o l u t i o n w e b d e s i g n 
[EMAIL PROTECTED]
www.revolutionwebdesign.com

its only looks good to those who can see bad as well
-anonymous

-Original Message-
From: Charlie Griefer [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 09, 2004 12:50 PM
To: CF-Talk
Subject: Re: 7 days old

assuming (yeah, yeah, i know) that dateAdded is a date/time datatype,
why the dateFormat() function?my understanding is that it's more for
formatting output/display (also, if it's a date/time datatype, no single
quotes).

i'd think if anything, you want to throw a createODBCDate() around that.

SELECT *
FROM whats_new
WHERE dateAdded = #createODBCDate(dateAdd('d', -7, now())#

- Original Message - 
From: Tony Weeg [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Friday, April 09, 2004 9:39 AM
Subject: RE: 7 days old

 oops in the code you will need to surround the dateFormat with the #'s

 so it would really look like...


 CFQUERY NAME=whatsnew DATASOURCE=puhweb
 select * FROM whats_new
 WHERE dateAdded = 
 '#dateFormat(dateAdd('d',-7,now()),'mm/dd/')#'
 order by dateAdded DESC
 /CFQUERY

 tony

 r e v o l u t i o n w e b d e s i g n [EMAIL PROTECTED]
 www.revolutionwebdesign.com

 its only looks good to those who can see bad as well -anonymous

 -Original Message-
 From: Tony Weeg [mailto:[EMAIL PROTECTED]
 Sent: Friday, April 09, 2004 12:35 PM
 To: CF-Talk
 Subject: RE: 7 days old


 hey dan.

 here is what ya want.

 CFQUERY NAME=whatsnew DATASOURCE=puhweb
 select * FROM whats_new
 WHERE dateAdded =
dateFormat(dateAdd('d',-7,now()),'mm/dd/')
 order by dateAdded DESC
 /CFQUERY

 hth

 tony

 r e v o l u t i o n w e b d e s i g n [EMAIL PROTECTED]
 www.revolutionwebdesign.com

 its only looks good to those who can see bad as well -anonymous

 -Original Message-
 From: Daniel Kessler [mailto:[EMAIL PROTECTED]
 Sent: Friday, April 09, 2004 12:31 PM
 To: CF-Talk
 Subject: 7 days old


 I'm doing a query for all records that are newer than 7 days.I 
 inserted the date using DateFormat(Now()).Unfortunately it gives me 
 an error that dateAdded is unidentified.True, it's a column and I 
 want it to search the column for anything less than 7 days old.Can 
 anyone help me word this WHERE?

 CFQUERY NAME=whatsnew DATASOURCE=puhweb
 select * FROM whats_new
 WHERE '#DateDiff(d,dateAdded,the_date)#'  7
 order by dateAdded DESC
 /CFQUERY

 thanks.

 --
 Daniel Kessler

 Department of Public and Community Health
 University of Maryland
 Suite 2387 Valley Drive
 College Park, MD20742-2611
 301-405-2545 Phone
 www.phi.umd.edu






 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: 7 days old

2004-04-09 Thread Jochem van Dieten
Daniel Kessler wrote:
 
 WHERE dateAdded  cfqueryparam cfsqltype=cf_sql_timestamp 
value=#DateAdd(d,-7,Now())#
 
 and would this change since it's ORACLE?

Why don't you just try it and tell us?

Jochem

-- 
I don't get it
immigrants don't work
and steal our jobs
- Loesje
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: 7 days old

2004-04-09 Thread Jochem van Dieten
Daniel Kessler wrote:
 Why don't you just try it and tell us
 
 Which one, the time-stamp?

The one where you wanted to know if it worked.

 Since there was several options mentioned I was trying to learn more 
 about the problems that I encountered with each.so are you saying 
 that I should try out an oracle version of 
 cfsqltype=cf_sql_timestamp?

Yes.

Jochem

-- 
I don't get it
immigrants don't work
and steal our jobs
- Loesje
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: 7 days old

2004-04-09 Thread Brook Davies
I am having some server issues with my server reporting NULL NULL and 
JavaOutofMemory Errors. This happened to me before and it was specifically 
caused by some bad regEx when parsing very large strings. Since it is 
happening again, I am looking at the regex usage in the app. Does this look 
like a greedy RegEx? Anyway to change it to make it more friendly?

rereplace(myVar,[[:space:]][[:space:]]*, ,all)

Brook Davies
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: 7 days old

2004-04-09 Thread Jochem van Dieten
Brook Davies wrote:

 I am having some server issues with my server reporting NULL NULL and 
 JavaOutofMemory Errors. This happened to me before and it was specifically 
 caused by some bad regEx when parsing very large strings. Since it is 
 happening again, I am looking at the regex usage in the app. Does this look 
 like a greedy RegEx?

No.

 Anyway to change it to make it more friendly?
 
 rereplace(myVar,[[:space:]][[:space:]]*, ,all)

rereplace(myVar,[[:space:]]+, ,all)

Jochem

-- 
I don't get it
immigrants don't work
and steal our jobs
- Loesje
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]