PC Review


Reply
Thread Tools Rate Thread

Replacement DFIRST for SQL

 
 
John Cosmas
Guest
Posts: n/a
 
      18th Apr 2004
Anyone know how to replace the DFIRST statement in Access to working in/with
SQL. SQL Server does not have an equavalent statement/function.

John Cosmas


 
Reply With Quote
 
 
 
 
Duane Hookom
Guest
Posts: n/a
 
      18th Apr 2004
You could use a subquery:
(SELECT TOP 1 YourField FROM tblYourTable ORDER BY OtherField)

--
Duane Hookom
MS Access MVP


"John Cosmas" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Anyone know how to replace the DFIRST statement in Access to working

in/with
> SQL. SQL Server does not have an equavalent statement/function.
>
> John Cosmas
>
>



 
Reply With Quote
 
Tim Ferguson
Guest
Posts: n/a
 
      19th Apr 2004
"John Cosmas" <(E-Mail Removed)> wrote in
news:#(E-Mail Removed):

> Anyone know how to replace the DFIRST statement in Access to working
> in/with SQL.


What on earth use is DFirst if you can't specify a sort order? It's not
going to be truly random, and it's not going to be specific either.

Any guesses?

Tim F

 
Reply With Quote
 
John Vinson
Guest
Posts: n/a
 
      19th Apr 2004
On Mon, 19 Apr 2004 11:40:17 -0700, Tim Ferguson
<(E-Mail Removed)> wrote:

>"John Cosmas" <(E-Mail Removed)> wrote in
>news:#(E-Mail Removed):
>
>> Anyone know how to replace the DFIRST statement in Access to working
>> in/with SQL.

>
>What on earth use is DFirst if you can't specify a sort order? It's not
>going to be truly random, and it's not going to be specific either.


It's only useful if you don't CARE which record you get. This can
happen; a join query might have only one record on the main table for
instance. In practice I rarely use it, and never under any
circumstances use DLast - it has the same problems and requires that
Access populate the entire recordset rather than just pulling the
first record.

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
 
Reply With Quote
 
Tim Ferguson
Guest
Posts: n/a
 
      20th Apr 2004
John Vinson <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in
news:(E-Mail Removed):

>>What on earth use is DFirst if you can't specify a sort order? It's not
>>going to be truly random, and it's not going to be specific either.

>
> It's only useful if you don't CARE which record you get. This can
> happen; a join query might have only one record on the main table for
> instance.


.... so wouldn't that be a normal DLookUp() function?


To be honest, I never even knew the functions existed, and even the help
file admits they return the value from a random record. Inexplicable.

B Wishes


Tim F

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dfirst Mighty Mouse Microsoft Access 7 26th Jul 2009 09:02 PM
Replacement DFIRST for SQL John Cosmas Microsoft Access Forms 2 19th Apr 2004 08:40 PM
Replacement DFIRST for SQL John Cosmas Microsoft Access ADP SQL Server 2 19th Apr 2004 08:40 PM
Replacement DFIRST for SQL John Cosmas Microsoft Access Queries 2 19th Apr 2004 08:40 PM
DFirst Alex Microsoft Access Queries 5 29th Jan 2004 06:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:16 PM.