Ask a Question related to Coldfusion Database Access, Design and Development.
-
Ad Bec #1
Date comparison in a text data field
I have a database column field defined as a text. I store dates in format:
dd/mm/yyyy.
The user passes a Start date search string in the same format. I need to
filter for dates larger or equal then this string. Can this be done?
Thanks!
The db system i use is PostgreSQL with MX 7
Ad Bec Guest
-
Outputting data using date field
I have a query that outputs the result based on date. I m writing it as: select * from apna where assignedto='#form.assignedto#' and... -
Date text Field
I have an asp form that is submitted to sql server 2000. There are three date fields. How can I allow the user to enter the date without any... -
Converting a text field to a date field - FM6
I need to convert a Text field containing both auto and manually entered dates over to a Date field. The records that were autoentered move over... -
Linking date field to text field entry
Is there a way to setup a date field that will automatically enter the date when any information is entered into a field next to it? -
date in text field
How can I include a date that is formatted in the following structure 9-July-03, and include it in a form text field? The form input code is:... -
Dan Bracuk #2
Re: Date comparison in a text data field
Yes, with string functions. It would be easier if you stored dates as dates, but you don't.
Dan Bracuk Guest
-
Ad Bec #3
Re: Date comparison in a text data field
Hi,
thanks for the answer Dan, Can you please tell me how can it be done with
string functions?
Here and example of the table:
ListingsSectionsSelectedValues.SectionCustomValue >= '28/12/2005'
Thanks for your help!
Ad Bec Guest
-
mxstu #4
Re: Date comparison in a text data field
I agree that it would be much better to store the date values in a date/time
column. Have you tried simply casting the column as a date/time in your query?
I don't know the correct syntax for PostgreSQL, but something like
WHERE CAST(yourColumn AS datetime) >= (some date value)
mxstu Guest
-
Dan Bracuk #5
Re: Date comparison in a text data field
I don't know postrgresql, but, what you have to do is re-arrange your string to
yyyymmdd. To do that in Cold fusion with the user input is simple -
x =right(date, 4) & mid(date, 3, 2) & left(date, 2);
If you can't do something similar in your database, you just put
where (your postgresql function stuff) < '#x#'
Otherwise, you could always select all rows (hope there are not that many,
loop though and rearrange the field using querysetcell and do a Q of Q. It
wouldn't be efficient, but it would get your answer.
Originally posted by: Ad Bec
Hi,
thanks for the answer Dan, Can you please tell me how can it be done with
string functions?
Here and example of the table:
ListingsSectionsSelectedValues.SectionCustomValue >= '28/12/2005'
Thanks for your help!
Dan Bracuk Guest
-
mxstu #6
Re: Date comparison in a text data field
>To do that in Cold fusion with the user input is simple -
Just a small correction. It should be:>x =right(date, 4) & mid(date, 3, 2) & left(date, 2);
x =right(date, 4) & mid(date, 4, 2) & left(date, 2);
mxstu Guest



Reply With Quote

