Query help

2002-11-03 Thread Chad
I know I have done this in the past, but I cannot figure it out for some reason. I want to grab out of a database the record with the highest value for the field RATING (it is an INT). I also want to grab all the data for the record like Image1, Description etc SELECT MAX(RATING), Image1,

Query Help

2002-11-05 Thread Mark Leder
Hi All, In a query, pulled from MS Access, I want to retrieve the five most recent postings (they are datestamped when inputted). I know how to do this in SQL, using top, but I can't figure out in Access. SELECT eID, city, state, country, datestamp WHERE datestamp = [five most recent] T

Query Help

2003-07-11 Thread Emmet McGovern
Maybe someone can help me I've written a photo gallery app and I'm having a problem with one of my queries. My gallery has several Main Categories (category table). Within each category is a subcategory (subcat table) that contains photosets (gallery table). After uploading a photoset you choose

Query Help

2003-07-11 Thread Harley Friedman
I'm assuming that all of your ID fields are autoincremented integers. Thus, the newest upload will be the one with the largest GalleryID. Try this: SELECT Category.CatName, Gallery.directory, subcat.Directory, photos.photo, photos.galimg, subcat.img FROMCategory, photos, subcat, G

Query help!

2003-01-13 Thread Scott Wilhelm
Can someone tell me what's wrong with this line: SELECT * FROM Events WHERE eDate < I can't figure out how to get a date query to work right... Thanks, Scott -Original Message- From: Costas Piliotis Sent: Mon 01/13/2003 01:01 PM To: CF-Talk

query help...

2003-01-29 Thread Houk, Gary
Hi all, I have a table with columns named q1,q2,q3, through q19. Each question can have a value of 1, 2, or 3. How can I generate a query/cfcode that will tell me how many people answered 1, 2, and 3 for question 1 through question 19 without having a ton of queries? I know it needs to loop som

QUERY Help

2003-01-29 Thread Cedric Villat
I'm having a bit of trouble with my query. What I have is a table with Tickets. I want to select all the tickets, which works great. Each Ticket has accompanying Threads, so each Ticket can have multiple threads (like a conversation). What I also need to grab along with the Tickets, is the NEWEST T

Query Help?

2002-08-09 Thread Kris Pilles
I need to write some SQL that says Delete from session where Last is 1 minute ago Delete >From Session Where Last < __ ??? __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www

Query help

2002-04-05 Thread stas
Hello, I have a table one column of which is a foreign key. For each unique value in this column I'd like to output 2 rows containing this value. Obviously, that would be pretty easy in CF, but I need it to be completely in SQL. Thanks for any tips! ___

query help...

2004-02-17 Thread Daniel Farmer
This is my query... select * from estates where featured = 1 and [ I want to select the oldest date_modified field here ] ~~ Daniel Farmer Coldfusion Developer / Sales / Producer 613.284.1684 ~~ [Todays Threads] [This Message] [Subs

Query help

2002-05-21 Thread Kris Pilles
How can Insert a record into a table (that I know how to do) but after the insert, I want to be able to know what the primary key for the record I just inserted... __ This list and all House of Fusion resources hosted by CFHosti

Query Help!

2000-11-06 Thread Jeff Fongemie
I'm missing something here. I have an Oracle database. A column named LIVE have a type of varchar2(3), with possible values of YES or NO. I have a simple query where I am attempting to get all records where LIVE is YES. Sounds easy right?? Why does this give me an error? SELECT headline,

query help

2000-11-06 Thread Jeff Fongemie
I'm missing something here. I have an Oracle database. A column named LIVE have a type of varchar2(3), with possible values of YES or NO. I have a simple query where I am attempting to get all records where LIVE is YES. Sounds easy right?? Why does this give me an error? SELECT headline,

Query Help

2000-03-27 Thread Duane Boudreau
I am using the following query to pull info from a DB and give me the record count for each doc_group_id. I've gotten to this point but this is as far as I can go. Can some SQL guru here lend a hand? SELECT doc_group_id, short_descr, (SELECT COUNT(doc_id) AS DocCount FROM documents WHERE

Query help

2000-05-02 Thread stäs
Hello, I am getting the below message: [INTERSOLV][ODBC Oracle 8 driver][Oracle 8]ORA-00937: not a single-group group function SQL = "SELECT SUM(PRICE) AS tot_price,ORDERID,CUSTOMERID,REPORTID,ORDERDATE,PRICE,TRANSAPPROVED,ORDER_TYPE FROM REIS.ORDERS WHERE TRANSAPPROVED = 'Y' AND ORDERDATE BE

Query Help

2001-11-21 Thread Clint Tredway
Ok.. why does it say this: Error: [Microsoft][ODBC SQL Server Driver][SQL Server]The column prefix 'Tickets' does not match with a table name or alias name used in the query. Query: SELECT Tickets.TicketID, Tickets.Problem, Tickets.DateEntered, Tickets.TicketStatus, Tickets.Priority, Us

Query help

2001-01-23 Thread Katrina Chapman
Merry Meet, I have a query that pulls data from almost identical tables and I need to know which rows come from which tables. IE: SELECT id, name FROM table1, table2 WHERE table1.name LIKE '%#search#%' OR table2.name LIKE '%#search#%' then in the output I need to know which table (1 or 2) each

Query Help!!

2001-05-11 Thread ibtoad
Does anyone see any problems with the following query: Select shiprate from shipratesdollars WHERE '#session.total#' >= shipfrom and '#session.total#' <= shipto I can not figure out why I am getting incorrect results. Sometimes it will pull more than one record and sometimes it will pull the

query help

2001-02-28 Thread Adrian Cesana
(second post, i didnt see it make it back) This query works fine but I need to select about 10-15 more columns from the Master (m) table. The only way I can seem to get that to work is if I also group on all the columns but this totally kills the query speed and Im not sure I am even getting corr

Query Help

2005-01-24 Thread Eric Hoffman
I have to make a report based upon this scenario...seems simple, yet I can't get the numbers rightany pointers? (I have ordered a newer Advanced SQL book in the meantime!!) Need to get orders within date range containing a part number and get total dollars received in payments for this. So I

RE: Query help

2002-11-03 Thread Andy Clary
@;careyweb.com] Sent: Sunday, November 03, 2002 8:54 AM To: CF-Talk Subject: Query help I know I have done this in the past, but I cannot figure it out for some reason. I want to grab out of a database the record with the highest value for the field RATING (it is an INT). I also want to grab all the data

RE: Query help

2002-11-03 Thread Jeff
Try this... SELECT Image1, Description FROM cars WHERE rating = (SELECT MAX(rating) FROM cars) HTH, Jeff Garza -Original Message- From: Chad [mailto:cgray@;careyweb.com] Sent: Sunday, November 03, 2002 8:54 AM To: CF-Talk Subject: Query help I know I have done this in the past, but

RE: Query help

2002-11-03 Thread Chad
Thanks guys... These queries did the trick! > -Original Message- > From: Jeff [mailto:jeff@;hawkandheron.com] > Sent: Sunday, November 03, 2002 11:01 AM > To: CF-Talk > Subject: RE: Query help > > Try this... > > SELECT Image1, Description > FROM car

RE: Query help

2002-11-03 Thread Jim Davis
e off) you're saying "get all the cars and sort them by rating, then just return the first one ("top 1"). Hope this helps, Jim Davis > -Original Message- > From: Chad [mailto:cgray@;careyweb.com] > Sent: Sunday, November 03, 2002 10:54 AM > To: CF-Talk &

RE: Query Help

2002-11-05 Thread Everett, Al
Try ordering by date descending and limiting to five rows. SELECT eID, city, state, country, datestamp ORDER BY datestamp DESC > -Original Message- > From: Mark Leder [mailto:mel@;markleder.com] > Sent: Tuesday, November 05, 2002 1:42 PM > To: CF-Talk > Subj

Re: Query Help

2002-11-05 Thread Randell B Adkins
Not sure you can but you might. However instead of the WHERE clause ADD a ORDER BY Clause and have it = DateStamp Then on the OUTPUT QUERY TAG set Maxrows = 5 Sure there maybe another way but that is one. >>> [EMAIL PROTECTED] 11/05/02 01:41PM >>> Hi All, In a query, pulled from MS Access, I

RE: Query Help

2002-11-05 Thread Mark Leder
Works great! Thanks. Thanks, Mark -Original Message- From: Everett, Al [mailto:AEverett@;askallied.com] Sent: Tuesday, November 05, 2002 1:58 PM To: CF-Talk Subject: RE: Query Help Try ordering by date descending and limiting to five rows. SELECT eID, city, state, country

Oracle query help

2002-10-15 Thread Kris Pilles
Heres the query: SELECT ALL STUDENT.STUDENT_NUM, STUDENT.LASTNAME, STUDENT.FIRSTNAME, STUDENT.BIRTHDATE, STUDENT.SEX, STUDENT.SSNUM, STSERVICE.DATE_BEGIN, STSERVICE.DATE_END, STSERVICE.LOCATION, STSERVICE.HANDICAP, STSERVICE.CSIZE_RATIO, STSERVICE.ST_CLASS, STSERVICE.FUND, STSERVICE.SERVICE, CUST

Simple Query Help

2003-02-05 Thread rick
I need to parse a query to a calendar database that returns just the current month's events, and I'm hung up on the Where part of the query (I'm obiously also getting very confused between CF and SQL functions). SELECT Title, Details, EventDate, StartHour, StartMin FROMEvents WHERE Da

RE: Query Help

2003-07-11 Thread Tony Weeg
working for jd? tony weeg uncertified advanced cold fusion developer tony at navtrak dot net www.navtrak.net office 410.548.2337 fax 410.860.2337 -Original Message- From: Emmet McGovern [mailto:[EMAIL PROTECTED] Sent: Friday, July 11, 2003 2:56 PM To: CF-Talk Subject: Query Help

RE: Query Help

2003-07-11 Thread Emmet McGovern
That works only if I want to display the last photo added. I need to display the last photo added to each category. Thanks for the help though Emmet -Original Message- From: Harley Friedman [mailto:[EMAIL PROTECTED] Sent: Friday, July 11, 2003 6:22 PM To: CF-Talk Subject: Query Help

RE: Query help!

2003-01-13 Thread Scott Wilhelm
I got it...I've gotta figure out a way to get ASP out of my head...lol Scott -Original Message- From: Scott Wilhelm Sent: Mon 01/13/2003 01:02 PM To: CF-Talk Cc: Subject: Query help! Can someone te

Re: Query help!

2003-01-13 Thread charlie griefer
try SELECT * FROM events WHERE eDate < ; (assuming your eDate field is a date/time datatype...i don't think you'd need a dateFormat() function) hth, charlie Scott Wilhelm writes: > Can someone tell me what's wrong with this line: > > > SELECT * FROM Events WHERE eDate < value=#f

Re: Query help!

2003-01-13 Thread Cutter (CF_Talk)
Instead of dateformat try createodbcdate(now()) Cutter Scott Wilhelm wrote: >Can someone tell me what's wrong with this line: > > > SELECT * FROM Events WHERE eDate < value=#formatdate(now(),"mm-dd-yy")#> > > >I can't figure out how to get a date query to work right... > >Thanks, > >Scott >

RE: Query help!

2003-01-13 Thread Mike Townend
Assuming that your running from a SQLServer or access DB (although it should work with mysql) try SELECT * FROM Events WHERE eDate < HTH -Original Message- From: Scott Wilhelm [mailto:[EMAIL PROTECTED]] Sent: Monday, January 13, 2003 18:02 To: CF-Talk Subject: Query h

Re: Query help!

2003-01-13 Thread Samuel R. Neff
Please look at the help docs for cfqueryparam. It takes at least two params, one for value and another for type. You should specify the type. Also note that you don't have to format the date when passing to cfqueryparam. Best regards, Sam BTW, a lot of people don't use cfqueryparam until t

RE: Query help!

2003-01-13 Thread Costas Piliotis
SELECT * FROM Events WHERE eDate < -Original Message- From: Samuel R. Neff [mailto:[EMAIL PROTECTED]] Sent: Monday, January 13, 2003 10:21 AM To: CF-Talk Subject: Re: Query help! Please look at the help docs for cfqueryparam. It takes at least two params, one for value

Query Help Again...

2003-01-14 Thread Scott Wilhelm
Can someone tell me what's wrong with this query? I've verified that everything between this query & the database matches up, I've printed out the SQL statement, and that was verified through my database that it's good... INSERT INTO Links(Text, URL, SBName, SBEmail, SBSchool, Category) VALUES(

Re: query help...

2003-01-29 Thread Steve Robison, Jr.
select q1, q2, from table At 03:49 PM 1/29/2003 -0500, you wrote: >Hi all, > >I have a table with columns named q1,q2,q3, through q19. Each question can >have a value of 1, 2, or 3. How can I generate a query/cfcode that will >tell me how many people answered 1, 2, and 3 for question

Re: query help...

2003-01-29 Thread Stephen Hait
> I have a table with columns named q1,q2,q3, through q19. Each > question can have a value of 1, 2, or 3. How can I generate a > query/cfcode that will tell me how many people answered 1, 2, and 3 > for question 1 through question 19 without having a ton of queries? > I know it needs to loop someh

RE: QUERY Help

2003-01-29 Thread CWatt
Why are you doing a max on the sentby table as well? You also may try doing an inner join as well. Also, If subject and priority could be different, you may want to get rid of them otherwise you are not going to get what you want. The easiest for this may be another approach if you must have those

RE: QUERY Help

2003-01-29 Thread CWatt
T.priority desc, T.ticketID -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 29, 2003 08:35 PM To: CF-Talk Subject: RE: QUERY Help Why are you doing a max on the sentby table as well? You also may try doing an inner join as well. Also, If subject

Re: QUERY Help

2003-01-29 Thread Cedric Villat
suooprt Query of Queries? Any other ideas? Cedric - Original Message - From: <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Wednesday, January 29, 2003 6:39 PM Subject: RE: QUERY Help > This got cut out...sorry! > > SELECT Th.sentBy,T.ti

RE: QUERY Help

2003-01-29 Thread CWatt
Villat [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 29, 2003 09:20 PM To: CF-Talk Subject: Re: QUERY Help Thanks for the help, but I'm getting an error. [MySQL][ODBC 3.51 Driver][mysqld-3.23.49-log]You have an error in your SQL syntax near 'SELECT Max(threadID) AS threa

Re: QUERY Help

2003-01-30 Thread Cedric Villat
Thanks! This worked great with a couple small modifications. Cedric - Original Message - From: <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Wednesday, January 29, 2003 9:42 PM Subject: RE: QUERY Help > You may have to put Select Max(ThreadID) AS

RE: Query Help?

2002-08-09 Thread Cantrell, Adam
WHERE last < #DateAdd("n", "-1", now())# Adam. > -Original Message- > From: Kris Pilles [mailto:[EMAIL PROTECTED]] > Sent: Friday, August 09, 2002 12:12 PM > To: CF-Talk > Subject: Query Help? > > > I need to write some SQL that says &

Delete Query Help

2002-04-01 Thread Frank Mamone
Hi, I want to delete a specific amount of records matching a criteria. I may have many records matching the crteria but I want to delete a specified amount. Is it possible to do this directly with SQL? Thank you, Frank Mamone __

RE: Query help

2002-04-05 Thread Cantrell, Adam
> To: CF-Talk > Subject: Query help > > > Hello, > > I have a table one column of which is a foreign key. For each > unique value > in this column I'd like to output 2 rows containing this > value. Obviously, > that would be pretty easy in CF, but I need

RE: Query help

2002-04-05 Thread Cantrell, Adam
. > -Original Message- > From: Cantrell, Adam [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 05, 2002 1:24 PM > To: CF-Talk > Subject: RE: Query help > > > Output two rows or two columns? > > I don't know about rows, but columns would be fairly easy: > > S

Re: Query help

2002-04-05 Thread stas
What I am looking to do would be like this in CF: SELECT DISTINCT number FROM table SELECT TOP 2 * FROM table WHERE number = #getNums.number# Is there anyway to combine this into one query? T-SQL maybe? - Original Message - From: "C

RE: Query help

2002-04-05 Thread Matthew R. Small
select top 2 * from table where number in (select distinct number from table) - Matt Small -Original Message- From: stas [mailto:[EMAIL PROTECTED]] Sent: Friday, April 05, 2002 3:32 PM To: CF-Talk Subject: Re: Query help What I am looking to do would be like this

RE: Query help

2002-04-05 Thread Cantrell, Adam
Adam. > -Original Message- > From: Matthew R. Small [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 05, 2002 2:53 PM > To: CF-Talk > Subject: RE: Query help > > > select top 2 * from table > where number in > (select distinct number from table) > > - Matt S

RE: Query help

2002-04-05 Thread Shawn Kernes
t: RE: Query help select top 2 * from table where number in (select distinct number from table) - Matt Small -Original Message- From: stas [mailto:[EMAIL PROTECTED]] Sent: Friday, April 05, 2002 3:32 PM To: CF-Talk Subject: Re: Query help What I am looking to do would be like

RE: Query help

2002-04-05 Thread Matthew R. Small
Hmmm... good catch. It certainly is Friday. -Original Message- From: Cantrell, Adam [mailto:[EMAIL PROTECTED]] Sent: Friday, April 05, 2002 3:46 PM To: CF-Talk Subject: RE: Query help Hehe, I was going to post the same thing, but I caught myself. That will only return two records

Re: Query help

2002-04-05 Thread stas
t; -Original Message- > From: Matthew R. Small [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 05, 2002 2:53 PM > To: CF-Talk > Subject: RE: Query help > > > select top 2 * from table > where number in > (

RE: Query help

2002-04-05 Thread Marian Dumitrascu
le t2 where t2.number = t4.number)) order by number -Marian :) > -Original Message- > From: stas [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 05, 2002 4:26 PM > To: CF-Talk > Subject: Re: Query help > > > Andrew - the query you posted using UNION SOLUTION

RE: Query help

2002-04-05 Thread Cantrell, Adam
Nice one Marian. Adam. > -Original Message- > From: Marian Dumitrascu [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 05, 2002 3:49 PM > To: CF-Talk > Subject: RE: Query help > > > try this , (but you'll need an unique id): > > select * from tabl

Re: Query help

2002-04-05 Thread stas
Wow, it works!. Are you a witch? :D Would you please unwind this query for me? - Original Message - From: "Marian Dumitrascu" <[EMAIL PROTECTED]> try this , (but you'll need an unique id): select * from table t1 where t1.id in (select top 1 id from table t2 where t2.number = t1.numb

RE: Query help

2002-04-05 Thread Andres
: Query help select top 2 * from table where number in (select distinct number from table) - Matt Small -Original Message- From: stas [mailto:[EMAIL PROTECTED]] Sent: Friday, April 05, 2002 3:32 PM To: CF-Talk Subject: Re: Query help What I am looking to do would be

Cached Query Help

2004-01-19 Thread Nikhil Madani
CFMX 6.1 Cached Query Problem: I have an XML file that I'm reading into a query object (to facilitate faster search) using the QueryNew(), QueryAddRow() and QuerySetCell() functions. Now, I need to hit this query often and I decided that caching it would be a good idea. Hence I did a query of query

Re:Cached Query Help

2004-01-20 Thread Nikhil Madani
Thanks..that worked out easier. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Re: query help...

2004-02-17 Thread Nick Han
select * from estates where featured = 1 and date_modified=(select max(date_modified) from estates) Nick Han >>> [EMAIL PROTECTED] 02/17/04 10:14AM >>> This is my query... select * from estates where featured = 1 and [ I want to select the oldest date_modified field here ]

RE: query help...

2004-02-17 Thread Tony Weeg
select * from estates where featured = 1 and date <= (select max(date_modified) from estates where featured = 1) maybe? -Original Message- From: Daniel Farmer [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 17, 2004 1:15 PM To: CF-Talk Subject: query help... This is my qu

Re: query help...

2004-02-17 Thread Daniel Farmer
this didn't work got error... using mySQL btw TCX][MyODBC]You have an error in your SQL syntax near   - Original MTCX][MyODBC]You have an error in your SQL syntax near essage -   From: Nick Han   To: CF-Talk   Sent: Tuesday, February 17, 2004 1:21 PM   Subject: Re: query

Re: query help...

2004-02-17 Thread Daniel Farmer
This didn't work either... TCX][MyODBC]You have an error in your SQL syntax near   - Original Message -   From: Tony Weeg   To: CF-Talk   Sent: Tuesday, February 17, 2004 1:24 PM   Subject: RE: query help...   select * from estates where featured = 1 and date <= (sele

Re: query help...

2004-02-17 Thread Steve Milburn
Daniel Farmer wrote: > This is my query... > > select * from estates where featured = 1 and > > [ I want to select the oldest date_modified field here ] > > > > ~~ > Daniel Farmer > Coldfusion Developer / Sales / Producer > 613.284.1684 > ~~

RE: query help...

2004-02-17 Thread Burns, John
ECTED] Sent: Tuesday, February 17, 2004 1:51 PM To: CF-Talk Subject: Re: query help... Daniel Farmer wrote: > This is my query... > > select * from estates where featured = 1 and > > [ I want to select the oldest date_modified field here ] > > > > ~~

RE: query help...

2004-02-17 Thread Philip Arnold
select top 1 * from estates where featured = 1 Order by date_modified desc > From: Daniel Farmer [mailto:[EMAIL PROTECTED] > > This is my query... > > select * from estates where featured = 1 and > > [ I want to select the oldest date_modified field here ] [Todays Threads] [This Message]

RE: query help...

2004-02-17 Thread Nick Han
use the first record?  Or if you're worried about passing all of that data back and forth you can use TOP (or whatever corresponds to your DB server) John Burns   -Original Message- From: Steve Milburn [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 17, 2004 1:51 PM To: CF-Talk S

Re: query help...

2004-02-17 Thread Daniel Farmer
OK that sounds like a good solution but how do I select the first record of a query ?   - Original Message -   From: Burns, John   To: CF-Talk   Sent: Tuesday, February 17, 2004 1:53 PM   Subject: RE: query help...   Why not select them ordered by date_modified and then just use the

Re: query help...

2004-02-17 Thread Daniel Farmer
I think this has been the closest yet... but still no work. =(   - Original Message -   From: Philip Arnold   To: CF-Talk   Sent: Tuesday, February 17, 2004 2:04 PM   Subject: RE: query help...   select top 1 *   from estates   where featured = 1   Order by date_modified desc

RE: query help...

2004-02-17 Thread Burns, John
uot; startrow="1" maxrows="1"> and that would just output the first record. John Burns -Original Message- From: Daniel Farmer [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 17, 2004 2:17 PM To: CF-Talk Subject: Re: query help... I think this has been the close

RE: query help...

2004-02-17 Thread Philip Arnold
> Well, if you do top 1 you would not want dates desc or the > first one would be the newest (right?).   Oops, I mis-read, the desc was in there as I thought he wanted the newest > Other than that, you > could just return the whole query (if there's no sort of top > syntax for your DB it'll w

RE: query help...

2004-02-17 Thread Philip Arnold
> Jeremy, I didn't use the rownum example because in the given > scenario, using rownum may not give you the latest mod date > record from the all records in the table. Won't it give you the first record if you specify an ORDER BY? [Todays Threads] [This Message] [Subscription] [Fast Unsu

RE: query help...

2004-02-17 Thread Pascal Peters
AIL PROTECTED] 02/17/04 10:53AM >>> > > Why not select them ordered by date_modified and then just use the > > first > > record?  Or if you're worried about passing all of that > data back and > > forth you can use TOP (or whatever corresponds to your DB

RE: query help...

2004-02-17 Thread Nick Han
Intuitively, you would think so, but it doesn't work that way.  The sql engine would do the rownum first and then apply the order-by clause after.   So if you do this, select * from users where rownum >=10 and last_name='SMITH' order by last_name, first_name, you might not get exactly what you exp

RE: query help...

2004-02-17 Thread Burns, John
3:12 PM To: CF-Talk Subject: RE: query help... > Well, if you do top 1 you would not want dates desc or the first one > would be the newest (right?). Oops, I mis-read, the desc was in there as I thought he wanted the newest > Other than that, you > could just return the whole query

RE: query help...

2004-02-17 Thread Philip Arnold
And people say that Oracle is better than SQL Server? I do TOP quite a lot, so it'd be annoying to have to bury my query in a sub-query that is "unnecessary" > Intuitively, you would think so, but it doesn't work that > way.  The sql engine would do the rownum first and then apply > the order-b

RE: Query help

2002-05-21 Thread Stephen Galligan
= @id SELECT @id -Original Message- From: Kris Pilles [mailto:[EMAIL PROTECTED]] Sent: 21 May 2002 14:06 To: CF-Talk Subject: Query help How can Insert a record into a table (that I know how to do) but after the insert, I want to be able to know what the primary key for the record I

RE: Query help

2002-05-21 Thread Andy Ewings
almost! instead of SELECT @@identity = @id you need SELECT @id = @@identity -Original Message- From: Stephen Galligan [mailto:[EMAIL PROTECTED]] Sent: 21 May 2002 15:14 To: CF-Talk Subject: RE: Query help Kris, In your Stored Proc you can use one of SQL's own vari

RE: Query help

2002-05-21 Thread Stephen Galligan
Just keeping you on your toes Boss! -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: 21 May 2002 15:18 To: CF-Talk Subject: RE: Query help almost! instead of SELECT @@identity = @id you need SELECT @id = @@identity -Original Message- From

RE: Query help

2002-05-21 Thread Kevin Schmidt
ssage- From: Kris Pilles [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 8:06 AM To: CF-Talk Subject: Query help How can Insert a record into a table (that I know how to do) but after the insert, I want to be able to know what the primary key for the record I just ins

RE: Query help

2002-05-21 Thread Christopher Olive
s.com -Original Message- From: Stephen Galligan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 10:14 AM To: CF-Talk Subject: RE: Query help Kris, In your Stored Proc you can use one of SQL's own variables @@identity to get the row id for the record you have just inserted. Simply assign

Re: Query help

2002-05-21 Thread Paul Giesenhagen
PROTECTED]> Sent: Tuesday, May 21, 2002 8:05 AM Subject: Query help > How can Insert a record into a table (that I know how to do) but after > the insert, I want to be able to know what the primary key for the > record I just inserted... >

RE: Query help

2002-05-21 Thread Rob Baxter
[mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 9:06 AM To: CF-Talk Subject: Query help How can Insert a record into a table (that I know how to do) but after the insert, I want to be able to know what the primary key for t

Re: Query help

2002-05-21 Thread Alex
What database? What are you using as a primary key (an ID number)? On Tue, 21 May 2002, Kris Pilles wrote: > How can Insert a record into a table (that I know how to do) but after > the insert, I want to be able to know what the primary key for the > record I just inserted... > _

RE: Query help

2002-05-21 Thread Kris Pilles
Access. Yeah autonumber field... I've never done this before seems like it would be a simple task -Original Message- From: Alex [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 10:29 AM To: CF-Talk Subject: Re: Query help What database? What are you using as a primary key (

RE: Query help

2002-05-21 Thread Won Lee
Almost all the answers are MS SQL-centric. Not sure what type of development house you work in, but MS-SQL centric answers are not a valid solution for some of us. Both Oracle and MS SQL have several methods to retrieve the last primary key in a particular table. I won't bore you with my opinion

RE: Query help

2002-05-21 Thread Rob Baxter
autonumber field it sounds like he's using MS Access, in which case I don't believe there even exists a datetimestamp column type. -Original Message- From: Won Lee [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 11:23 AM To: CF-Talk Subject: RE: Query help Almost all

RE: Query help

2002-05-21 Thread Won Lee
I agree with you, 99% of the time it will be Access or SQL Server. I just gave another possible answer because I wanted to shed another view. Access also has a date/time field which one can create a CF variable and then insert that in and then check against the cf variable. Works well. At 11:41

RE: Query help

2002-05-21 Thread Rob Baxter
oever started this thread is paying attention to my ramblings at this point anyway. -Original Message- From: Won Lee [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 11:50 AM To: CF-Talk Subject: RE: Query help I agree with you, 99% of the time it will be Access or SQL Server. I just

RE: Query help

2002-05-21 Thread Ben Johnson
If you're using SQL Server, it's not always good practice to use @@IDENTITY. Instead, use SCOPE_IDENTITY(). SCOPE_IDENTITY() is the same as @@IDENTITY, except it limits the scope. For example, if you insert a row into TableA, but that table has an insert trigger that does some processing and ins

RE: Query help

2002-05-21 Thread Dave Watts
> Also, SCOPE_IDENTITY() may have been recently added. It may > be a SQL Server 2000 feature so if you're using anything > prior, you may be out of luck. Anybody else know if this > is new to SQL Server 2000? Yes, it's new to SQL Server 2000. Dave Watts, CTO, Fig Leaf Software http://www.figl

RE: Query help

2002-05-21 Thread Rob Baxter
-Talk Subject: RE: Query help If you're using SQL Server, it's not always good practice to use @@IDENTITY. Instead, use SCOPE_IDENTITY(). SCOPE_IDENTITY() is the same as @@IDENTITY, except it limits the scope. For example, if you insert a row into TableA, but that table has an insert tr

Distinct Query help

2002-05-29 Thread Amanda Stern
Hello, I am having a little trouble constructing this query because I need a count of a " distinct composite column combo - Date and CMid"..for example..here is the table and the columns in it: DateCMid value rate - -- -- -- 02/021 3 6 02/021

Date query help

2002-06-02 Thread Brian Simpson
Since I'm still very new to CF, I'm back at the trough for some more help. First I'm like to say thinks to all that have help in the past and any help I can get on this one, since I've been beating my head for three days on at. I have a database that has the Date Of Birth (DOB) stored in mm/dd/

search query help

2000-10-31 Thread Kay Smoljak
Hi all, I have this simple search query that's perplexing me somewhat. select news.title, news.subtitle, news.dated, news.id, news.article fromnews where news.complete = 1 and news.article like '#form.keywords#%' or

Re: Query Help!

2000-11-06 Thread Gena
> Why does this give me an error? try WHERE live is 'YES' or WHERE live = 'YES' or WHERE live like 'YES' Regards, Gennadi Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Uns

Re: query help

2000-11-06 Thread Nathan Chen
Jeff, The "where" clause in your query is not correct. It should be SELECT headline, news, blurb, date_entered, newsID, live FROM news WHERE live = 'Yes' ORDER by date_entered DESC Nathan Chen Jeff Fongemie wrote: > I'm missing something here. > > I have an Oracle database

RE: Query Help

2000-03-28 Thread Duane Boudreau
Hi All, Thanks to all those that answered my cry for SQL help. David's query did the trick. Thanks David Duane -Original Message- From: David Cummins [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 28, 2000 12:12 AM To: [EMAIL PROTECTED] Subject: Re: Query Help Hi Duane. Hav

  1   2   3   4   >