Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
frankjshin #1
Query Help Please
Hi,
This is from a calendar app that I got from the Exchange. I am in the midst
of switching over the database from Access to Oracle. From this query, I get
an invalid column name error from Oracle. Any ideas? The field cal_date does,
in fact, exist. When I throw the query into sql plus (minus the day function),
it works fine...
<cfquery name="calappshow" datasource="#protdsn#">
SELECT #appttable#.*, (day(cal_date)) AS getthisday
FROM #appttable#
WHERE cal_date >= '#dateformat(CreateDate(Year(DateOb),Month(DateOb) ,1),
'dd-mmm-yyyy')#'
AND cal_date <=
'#dateformat(CreateDate(Year(DateOb),Month(DateOb) ,DaysInMonth(DateOb)),
'dd-mmm-yyyy')#'
</cfquery>
Thanks,
Frank
frankjshin Guest
-
Query of Queries on query New type query
In CF5 we have a page that creates a query, using queryNew and querySetCell and the like, we then used dbtype="query" and gave it's name so we could... -
query of query throwing weird exception
One workaround: I had added rows to a cfsearch query, and set a numeric value in custom1 field that that query provides. A query of queries... -
Convert a query to a list, or find an item in a query
Hi All, I am using CFPOP to retrieve mail from a server, then delete each message after I retrieve it. What I want to do is to check that I don;t... -
CAML Query: Multiple Query Fields Issue
I need to Create a CAML Query Dynamically with VB to a Sharepoint WebService GetListItems Method. The User Could Select 1 to X Number of IDs... -
BCP query out executed by xp_cmdshell works fine from query analyzer but fails from VB Component
Hi all, I have a stored procedure which returns a vast number of record and i have to write the output into a csv file. I'm using BCP utility to... -
tconley #2
Re: Query Help Please
(day(cal_date)) as getthisday. Is day() an Oracle function? I can't find a
reference
In sqlplus does the WHERE statement work? cal_date = 'a date string' seems
like it shouldn't work.
There may be other ways but I always use the Oracle TO_DATE and TO_CHAR
functions when dealing with dates. Your query would be something like:
SELECT #apptable#.*, TO_CHAR(cal_date, 'DD') AS getthisday
FROM #apptable#
WHERE cal_date >=
TO_DATE('#dateformat(CreateDate(Year(DateOb),Month (DateOb),1),
'dd-mmm-yyyy')#', 'DD-MON-YYYY')
AND cal_date <=
TO_DATE('#dateformat(CreateDate(Year(DateOb),Month (DateOb),DaysInMonth(DateOb)),
'dd-mmm-yyyy')#', 'DD-MON-YYYY')
which should wind up being:
SELECT faketablexx.*, TO_CHAR(cal_date, 'DD') AS getthisday
FROM faketablexxx
WHERE cal_date >= TO_DATE('01-Jul-2005', 'DD-MON-YYYY')
AND cal_date <= TO_DATE('31-Jul-2005', 'DD-MON-YYYY')
tconley Guest



Reply With Quote

