Supposing that there are no problems with the code itself...

Why don't you use CreateODBCDateTime instead of CreateODBCDate in your code?
At least in that way you will store date information with greater detail...
if the DB is prepared to accept a date/time object for that field.

Also... i had lots of problems once because i used "Date" as the name for
one of my fields in a table. I would recommend you to change it. It could be
reserved and/or confuse the database manager.

Francisco J. Montes-Mantero
Web Developer
QSP Financial Information Systems
[EMAIL PROTECTED]
ICQ: 23816813

----- Original Message -----
From: "Juan Manuel Tapiola" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 11, 2000 2:12 PM
Subject: About changing the oldest one


Hello, I have a database composed of 4 items per category which I want to
replace from the oldest one with new products.  I do this instruction then:

<!--- I FIND THE OLDEST ITEM --->
<CFQUERY DATASOURCE="principal" QUERY="oldest">
SELECT
MIN(date) AS oldest
FROM recomendadas
WHERE category = #form.category#
</CFQUERY>

<!--- I REPLACE --->
<CFQUERY DATASOURCE="principal">
UPDATE recomendadas
SET cod = #form.cod#
titulo = #form.titulo#
WHERE category = #form.category#
<CFOUTPUT QUERY="oldest">
AND date = #createODBCdate(oldest)#
</CFOUTPUT>
</CFQUERY>

The problem with this is that it just replaces the item if it is 2 days old.
What should I do if I just want to replace the oldest one, no matter if it
is older by a minute?

As an additional data, I made a DB with one minute difference between items
an isolates perfectly the oldest item with this function:

CreateODBCdateTime(oldest)

But I don't know why it does not do it in the above query.

Could anybody help me in this?

I appretiate it a lot

Manuel Tapiola
www.ciudadvideo.com

----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=sts&body=sts/cf_talk or send
a message to [EMAIL PROTECTED] with 'unsubscribe' in the
body.


------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to