7 days old

2004-04-09 Thread Daniel Kessler
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
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]




7 days old

2004-04-09 Thread Daniel Kessler
WHERE dateAdded = '#dateFormat(dateAdd('d',-7,now()),'mm/dd/')#'
I guess this works cause it's querying a date field with a date. 
Interestingly, it previously had {currentDate()-7}.Maybe it was 
currDate().I'm updating it.

So now it's doing the query, it's giving me not a valid month, but 
It seems to me that we're adding a date here (subtracting really). 
Looks like this is close.

Oh wait, I did:WHERE dateAdded  #dateAdd(d,-7,Now())#
This seems to have worked.I removed the dateFormat because as 
suggested, it seemed unnecessary.I also removed the quotes.I 
don't have alot of data to test from but it seems ok.

WHERE dateAdded = DATEADD('d',-7,getDate())
well this is ORACLE, but the function looked the same there, though I 
didn't look up getDate();
This gave me the error,  invalid column name, though I don't know 
why as dateAdded is the right column.It specifies the top line of 
the query with the error.

WHERE dateAdded = #createODBCDate(dateAdd('d', -7, now())#
error:
Invalid CFML construct found on line 34 at column 64. (the WHERE line)
ColdFusion was looking at the following text:
#

assuming (yeah, yeah, i know) that dateAdded is a date/time datatype,
why the dateFormat() function?
good point.

WHERE dateAdded  cfqueryparam cfsqltype=cf_sql_timestamp 
value=#DateAdd(d,-7,Now())#

and would this change since it's ORACLE?
sorry folks, I should have mentioned that it was ORACLE.

I'm doing a query for all records that are newer than 7 days.

whew.

-- 
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]




7 days old

2004-04-09 Thread Daniel Kessler
Why don't you just try it and tell us

Which one, the time-stamp?

As far as getting it working, I did mention that I used:
WHERE dateAdded  #dateAdd(d,-7,Now())#
which didn't have the DateFormat or the single-quotes.

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?

-- 
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:
 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]




7 days old

2004-04-09 Thread Daniel Kessler
Why don't you just try it and tell us?

I had tried it and received an error, though now hours later I don't 
remember the error.Since I'm a bit new at this, I don't know if the 
error was due to me or the fact that I was trying several things at 
once and one after the other, or that it didn't apply to Oracle.
I did a search before I wrote back and didn't find any references to 
'cfqueryparam' and oracle.I had barely any hits and saw a mention 
that it was for SQL, which I assumed meant NOT Oracle, so that's why 
I asked.
I don't know whether it's not for Oracle or that it 'just worked' as 
is for Oracle and no one mentions it specifically.So

Anyhoo, I have it working and I learned a bit.

Thanks for all the replies.

-- 
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]