How is this for strangeness???

This now works...

        <cfquery name="qGetMonthsData" datasource="Tech">
        SELECT FeedbackID, SubmittedBy, SubmittedDate, Q1, Comments, CallID
      FROM Feedback
        WHERE Month(SubmittedDate) = #URL.Month# 
        ORDER by SubmittedDate DESC
        </cfquery>

It didn't work for me earlier... No idea why.

Anyway, thank you for all of your help lovely cfaussie people!

Regards,

Kylie


-----Original Message-----
From: Antony Sideropoulos [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 6 August 2003 3:25 PM
To: CFAussie Mailing List
Subject: [cfaussie] RE: Query on a query!


Maybe you could try this for your criteria:

Where SubmittedDate Between #CreateDate("2003",URL.Month,"01")# AND
#CreateDate("2003",URL.Month,"31")#

To work out the last day of the month, use this udf:

http://www.cflib.org/udf.cfm?ID=639


<cfscript>
/**
 * Returns a date object representing the last day of the given month.
 * 
 * @param strMonth       Month you want to get the last day for,
(Required)
 * @param strYear        Year for the specified month.  Useful for leap
years.  The default is the current year. (Optional)
 * @return Returns a date object. 
 * @author Ryan Kime ([EMAIL PROTECTED]) 
 * @version 1, May 7, 2002 
 */
function LastDayOfMonth(strMonth) {
  var strYear=Year(Now());
  if (ArrayLen(Arguments) gt 1)
    strYear=Arguments[2];
  return DateAdd("d", -1, DateAdd("m", 1, CreateDate(strYear, strMonth,
1))); } </cfscript>

Giving you a criteria of:

Where SubmittedDate Between #CreateDate("2003",URL.Month,"01")# AND
#LastDayOfMonth(URL.Month)#


(Note: you may have to fool around with the syntax a bit)


>>> [EMAIL PROTECTED] 6/08/2003 3:12:25 pm >>>
Hi,
 
I know Access does support DatePart() as I've used it before and I'm certain
that the two fields are the same data type.
 
The part about referencing an alias in my where clause is the part I'm not
certain about.  I did try this....
 
 <cfquery name="qGetMonthsData" datasource="Tech">
 SELECT FeedbackID, SubmittedBy, SubmittedDate, Q1, Comments, CallID  FROM
Feedback  WHERE Month(SubmittedDate) = #URL.Month#  
 ORDER by SubmittedDate DESC  
 </cfquery>
 
But I get the same error.
 
All I want to do is display results from a table broken down by month, where
the month displayed is the one asked for in the url. The month to compare
comes from the DateSubmitted field. I didn't want to have to store a
seperate month field to query by, but it looks like I'll have to.
 
:(
 
Thanks Steve.

-----Original Message-----
From: Steve Onnis [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 6 August 2003 1:09 PM
To: CFAussie Mailing List
Subject: [cfaussie] RE: Query on a query!


Few things maybe
 
I dont think ACCESS supports DatePart()
Does the variable URL.Month confirms with the data type of MontheRequested?
MonthRequested is an alias, so I dont think you can reference it in your
query as a valid column name.
 
A few things to look at
 
Steve

-----Original Message-----
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] Behalf Of Kylie Lindstrom
Sent: Wednesday, August 06, 2003 12:58 PM
To: CFAussie Mailing List
Subject: [cfaussie] Query on a query!


Hi All,
 
Can someone tell me what my obvious flaw in this query is?
 
 <cfquery name="qGetMonthsData" datasource="Tech">
 SELECT FeedbackID, SubmittedBy, DatePart('m', SubmittedDate) AS
MonthRequested, SubmittedDate, Q1, Comments, CallID
    FROM Feedback
  WHERE MonthRequested = #URL.Month#  
 ORDER by SubmittedDate DESC  
 </cfquery>
 
The error I get is this: 
 
  


Error Executing Database Query. 

[MERANT][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft
Access Driver] Too few parameters. Expected 1.  
 
Thanks to all in advance!
 
 
Kylie Lindstrom
Web Designer

Liberty Financial
Telephone    (61 3) 8635 8803
Facsimile      (61 3) 8635 9988
Mobile           (0407) 366 797
Website          <http://www.liberty.com.au/> www.liberty.com.au 

_____________________________________________________________________
NOTICE - This message contains confidential information intended only for
the use of the addressee named above. If you are not the intended recipient
of this message you are hereby notified that you must not disseminate, copy
or take any action in reliance on it. If you have received this message in
error please notify Liberty Financial in Australia on (61 3) 8635 8888
immediately. Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be the views of
Liberty Financial.
_____________________________________________________________________ 
 
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED] 
To unsubscribe send a blank email to
[EMAIL PROTECTED] 

MX Downunder AsiaPac DevCon - http://mxdu.com/ 

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED] 
To unsubscribe send a blank email to
[EMAIL PROTECTED] 

MX Downunder AsiaPac DevCon - http://mxdu.com/ 



---
You are currently subscribed to cfaussie as:
[EMAIL PROTECTED] 
To unsubscribe send a blank email to
[EMAIL PROTECTED] 

MX Downunder AsiaPac DevCon - http://mxdu.com/

----------------------------------------------------------------------
Maddocks
Melbourne - Tel: (61 3) 9288 0555  Fax: (61 3) 9288 0666   
Sydney - Tel: (61 2) 8223 4100  Fax: (61 2) 9221 0872
Web: http://www.maddocks.com.au 
----------------------------------------------------------------------
The information in this electronic mail is privileged
and confidential, intended only for use of the individual
or entity named.  If you are not the intended recipient,
any dissemination, copying or use of the information is strictly prohibited.
If you have received this transmission in error please delete it immediately
from your system and inform us by email on [EMAIL PROTECTED]
----------------------------------------------------------------------


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To
unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to