Re: Get Records where form.year = year of date in database...

2004-08-17 Thread Don
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

Re: Get Records where form.year = year of date in database...

2004-08-17 Thread Barney Boisvert
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,

Get Records where form.year = year of date in database...

2004-08-17 Thread Les Mizzell
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

RE: Get Records

2004-02-03 Thread Pascal Peters
; 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

RE: Get Records

2004-02-03 Thread Stuart Kidd
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

RE: Get Records

2004-02-03 Thread Pascal Peters
[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

RE: Get Records

2004-02-03 Thread Stuart Kidd
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

RE: Get Records

2004-02-03 Thread Pascal Peters
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

RE: Get Records

2004-02-03 Thread Cameron Childress
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

RE: Get Records

2004-02-03 Thread Stuart Kidd
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

RE: Get Records

2004-02-03 Thread Stuart Kidd
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

RE: Get Records

2004-02-03 Thread Pascal Peters
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

Get Records

2004-02-03 Thread Stuart Kidd
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

RE: How to get records from this month and only this month

2001-07-08 Thread Dylan Bromby
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

RE: How to get records from this month and only this month

2001-07-08 Thread Aidan Whitehall
> 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

How to get records from this month and only this month

2001-07-08 Thread John Barleycorn
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