Ask a Question related to Coldfusion Database Access, Design and Development.
-
ghouser #1
Newbie date from DB question
Probably a simple thing for most of you but....
I have an Access DB with a date field which holds month, date, year, and time
whch are all populated. I also have a form which passes a selected value for
the month, ie: 1 for Jan, 2 for Feb. etc. into a CF page to retrieve and
display records.
My desire is to be able to pull only the records from the database for a
specific month then order them by the date within that month, then by time for
display. It sounds easy and it should be... but I cannot seem contruct the
"where" and "order by" based on only part of the retrieved date field.
ghouser Guest
-
Newbie can't get date range search from form to work
Please help! I'm banging my head against a wall here. This is my first stab at ASP. I'm able to pass vars from a form to a search results page... -
Pen Tool Use Question. (Embarrassingly Newbie Question)
I'm currently using Flash MX and whenever I choose the Pen Tool instead of the pen nib with the small "x" beside it that supposed to show up on... -
newbie: day number in year to gregorian date?
Hi, I'm trying to convert a serial day int to a gregorian date. It is very easy the other way by using date("z"), but the other way around is a... -
converting date into database date format(newbie)
Hi! U can convert "8-Aug-03" into mysql date which requires yyyy-mm-dd format as below. <?php date("Y-m-d",strtotime("8-Aug-03")); ?> -
formatting a date field in a datagrid colum - newbie
I'm working with a datagrid control and needing to format a date field(from access) so that it just has dd/mm. Do I format it in the Tag or in ... -
paross1 #2
Re: Newbie date from DB question
One possibility...
SELECT your_fields
FROM your_table
WHERE month(date_field) = #form.month#
ORDER BY date_field
Phil
paross1 Guest
-
Kronin555 #3
Re: Newbie date from DB question
It's going to depend on which database you use, and the date formatting
functions that database has. In Postgresql, it's date_part.
eg:
select * from tbleventlog where date_part('day',logdate) = 16 and
date_part('month',logdate) = 3 order by logdate;
I don't know what it is in Access, but you can search on "date formatting".
Kronin555 Guest
-
ghouser #4
Re: Newbie date from DB question
I tried something very similar to what you posted Phil but not quite the same.
So what you are saying is that month() will return just the month portion of
the date field value. I can believe it is that simple but I couldn't find that
function as you used it. I did find date_part() which I thought might work as
well.
I'll try what you suggest and see if it works as easy as I expect it will.
Thanks!
ghouser Guest
-
paross1 #5
Re: Newbie date from DB question
From the Access 97 Help...
Month Function
Returns a Variant (Integer) specifying a whole number between 1 and 12,
inclusive, representing the month of the year.
Syntax
Month(date)
The required date argument is any Variant, numeric expression, string
expression, or any combination, that can represent a date. If date contains
Null, Null is returned.
Phil
paross1 Guest



Reply With Quote

