Edit your WHERE CLAUSE as follows,
WHERE Year(databaserecord.date) = #FORM.year#
btw, name a column as "date" is not a good practice.
>I've got a "smalldatetime" field in a SQL database.
>
>In a query, I need to be able to pull all records where the year of this
>field equals the year value ente
You have to use a SQL function, not a CF function, inside your query.
Most databases have something equivalent to CF's dateCompare, but if
not, you can always hack it with a BETWEEN clause, using the first and
last datetimes of the year. Have to check the documentation for you
database.
cheers,
I've got a "smalldatetime" field in a SQL database.
In a query, I need to be able to pull all records where the year of this
field equals the year value entered in a form..
Don't have too much trouble comparing dates outside of queries, but
inside I always get something wrong...
I'd love to be
; From: Stuart Kidd [mailto:[EMAIL PROTECTED]
> Sent: dinsdag 3 februari 2004 20:12
> To: CF-Talk
> Subject: RE: Get Records
>
> Hi Pascal,
>
> I've been trying to give that one a go but
Peters [mailto:[EMAIL PROTECTED]
Sent: 03 February 2004 12:37
To: CF-Talk
Subject: RE: Get Records
SELECT Top 10 id, ... FROM table
WHERE {conditions}
AND id NOT IN (
SELECT Top #x# id FROM table
WHERE {conditions}
ORDER BY {columns}
)
ORDER BY {columns}
Where x is the number of records in the
[EMAIL PROTECTED]
> Sent: dinsdag 3 februari 2004 12:40
> To: CF-Talk
> Subject: RE: Get Records
>
> Thanks for that Cameron and Pascal, that works fine. But is
> there a way in the SQL query to specify start and end rows?
>
> I'm outputting the info to an html
ut that means everytime that page loads it's
getting all the rows from the database.
Cheers,
Stuart
-Original Message-
From: Pascal Peters [mailto:[EMAIL PROTECTED]
Sent: 03 February 2004 11:29
To: CF-Talk
Subject: RE: Get Records
SELECT Top 10
> -Original Message
SELECT Top 10
> -Original Message-
> From: Stuart Kidd [mailto:[EMAIL PROTECTED]
> Sent: dinsdag 3 februari 2004 11:24
> To: CF-Talk
> Subject: RE: Get Records
>
> It's Access.
>
> -Original Message-
> From: Pascal Peters [mailto:[EMAIL PRO
Not sure if access supports the TOP keyword, but this works in MSSQL Server:
SELECT Top 10 columnname, columnname...
FROM
Probably works in Access too...
-Cameron
-
Cameron Childress
Sumo Consulting Inc.
---
land: 858.509.3098
cell: 678.637.5072
aim: cameroncf
email: [EM
It's Access.
-Original Message-
From: Pascal Peters [mailto:[EMAIL PROTECTED]
Sent: 03 February 2004 10:21
To: CF-Talk
Subject: RE: Get Records
What DB?
> -Original Message-
> From: Stuart Kidd [mailto:[EMAIL PROTECTED]
> Sent: dinsdag 3 februari 2004 10:58
ecord
to start from and where to end?
Cheers,
Stuart
-Original Message-
From: Stuart Kidd [mailto:[EMAIL PROTECTED]
Sent: 03 February 2004 09:58
To: CF-Talk
Subject: Get Records
Hi guys, can someone tell me the way I can specify how many records to
get, e.g. just the fir
What DB?
> -Original Message-
> From: Stuart Kidd [mailto:[EMAIL PROTECTED]
> Sent: dinsdag 3 februari 2004 10:58
> To: CF-Talk
> Subject: Get Records
>
> Hi guys, can someone tell me the way I can specify how many
> records to get, e.g. just the first 1
Hi guys, can someone tell me the way I can specify how many records to
get, e.g. just the first 10 records?
SELECT
PropertyData.PropertyDataID, PropertyData.PropertyDataAgentReference,
PropertyData.PropertyDataFlatNumberHouseName,
PropertyData.PropertyDataStreetNumber,
PropertyData.PropertyData
use the BETWEEN operator in your SQL statement and use the first and last of
the month.
-Original Message-
From: John Barleycorn [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 06, 2001 11:58 PM
To: CF-Talk
Subject: How to get records from this month and only this month
Hello, i need to
> SELECT quantity_nb
> FROM tblDailyNumbers nb
> WHERE DateDIFF(mm, #CreateODBCDate(Now())#, getDate()) = 0
> AND DateDIFF(yy, #CreateODBCDate(Now())#, getDate()) = 0
The syntax of this may be wrong but I'm pretty sure you want something more
like this
SELECT quantity_nb
FROM tblDailyNumbers
Hello, i need to pull records out of my database for one month and only that
month (default current month, but can be any month). I've tried using:
SELECT quantity_nb
FROM tblDailyNumbers nb
WHERE DateDIFF(mm, #CreateODBCDate(Now())#, getDate()) = 0
AND DateDIFF(yy, #CreateODBCDate(Now())#, get
16 matches
Mail list logo