RE: Simple Query Help

2003-02-05 Thread Robertson-Ravo, Neil (RX)
Yep you are...

>> WHEREDatePart(,EventDate) =  AND
DatePart(,EventDate)= 

This will not work... the first part of the Where clause needs to be
something like

WHERE EventDate >= '[YOURDATE]'

I am not sure what format your date is in, but I think you get the idea :-p

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 05 February 2003 14:38
To: CF-Talk
Subject: Simple Query Help


I need to parse a query to a calendar database that returns just the current
month's events, and I'm hung up on the Where part of the query (I'm obiously
also getting very confused between CF and SQL functions).  


SELECT Title, Details, EventDate, StartHour, StartMin 
FROMEvents 
WHERE   DatePart(,EventDate) =  AND DatePart(,EventDate)= 
ORDER BY EventDate ASC


Am I on the right track here?  Is there a better way?  

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4




Re: Simple Query Help

2003-02-05 Thread Jochem van Dieten

SELECT
Title,
Details,
EventDate,
StartHour,
StartMin
FROM
Events
WHERE
EXTRACT (YEAR FROM EventDate) = 
AND
EXTRACT (MONTH FROM EventDate) = 
ORDER BY
EventDate ASC


Jochem

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
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.

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4




RE: Simple Query Help

2003-02-06 Thread Kennerly, Rick H CIV
You're one fine CF man.  Thanks.

Rick  

-Original Message-
From: Jochem van Dieten [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 05 February, 2003 10:45
To: CF-Talk
Subject: Re: Simple Query Help



SELECT
Title,
Details,
EventDate,
StartHour,
StartMin
FROM
Events
WHERE
EXTRACT (YEAR FROM EventDate) = 
AND
EXTRACT (MONTH FROM EventDate) = 
ORDER BY
EventDate ASC


Jochem


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
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

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4




RE: Simple Query Help

2003-02-06 Thread Kennerly, Rick H CIV
I see said the blind man.  Thanks for the assist! 

Rick 

-Original Message-
From: Robertson-Ravo, Neil (RX)
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 05 February, 2003 10:38
To: CF-Talk
Subject: RE: Simple Query Help


Yep you are...

>> WHEREDatePart(,EventDate) =  AND
DatePart(,EventDate)= 

This will not work... the first part of the Where clause needs to be
something like

WHERE EventDate >= '[YOURDATE]'

I am not sure what format your date is in, but I think you get the idea :-p

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 05 February 2003 14:38
To: CF-Talk
Subject: Simple Query Help


I need to parse a query to a calendar database that returns just the current
month's events, and I'm hung up on the Where part of the query (I'm obiously
also getting very confused between CF and SQL functions).  


SELECT Title, Details, EventDate, StartHour, StartMin 
FROMEvents 
WHERE   DatePart(,EventDate) =  AND DatePart(,EventDate)= 
ORDER BY EventDate ASC


Am I on the right track here?  Is there a better way?  


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
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

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4




Re: Simple Query Help

2003-02-06 Thread Stephen Moretti
Rick,

You might find that you can use :

Year(EventDate) = #Year(Now())#

rather than

EXTRACT (YEAR FROM EventDate) = 

Depends on the database you're using.

You can use the cfqueryparam in both versions of the SQL statement. Just
thought I'd get rid of it as Year(Now()) will return an integer.

Regards

Stephen

- Original Message -
From: "Jochem van Dieten" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, February 05, 2003 2:45 PM
Subject: Re: Simple Query Help


> 
> SELECT
> Title,
> Details,
> EventDate,
> StartHour,
> StartMin
> FROM
> Events
> WHERE
> EXTRACT (YEAR FROM EventDate) =  cfsqltype="cf_sql_integer" value="#Year(Now())#">
> AND
> EXTRACT (MONTH FROM EventDate) =  cfsqltype="cf_sql_integer" value="#Month(Now())#">
> ORDER BY
> EventDate ASC
> 
>
> Jochem
>
> 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4