Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 3:55 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Limit database records
PostPosted: November 2nd, 2007, 2:26 pm 
Offline

Joined: November 9th, 2004, 10:35 am
Posts: 49
Location: Canterbury UK
Is there a limit sql function that can be appled to a database call in Opus?

Iv'e tried as in the example below and get no results returned.

var records = mydb.ExecuteSQL("SELECT * FROM TelLog ORDER BY tel_RecNo DESC LIMIT 50 ;")

All works ok without the LIMIT statement?

_________________
Andy
Hayward Design
E: andy@hayward-design.co.uk
T: 01227 721864

Opus Professional Version v6.00
Build Date Jun 18 2007 15:01:07
Windows XP Professional - Build 2600 Service Pack 2
Total Memory 1024 Mb
DirectX Version 9.0 or better
AMD Athlon


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 2nd, 2007, 5:21 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Like a lot of SQL Limit is DB specific - which one are you connecting to?

Also, limit can take two parameters, the starting position and the number of rows to return from said position IE:

Limit 10, 5

is start at row 10 of results and return five rows.


Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 3rd, 2007, 2:22 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Possible syntax? Does semicolon belong inside ?

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject:
PostPosted: November 6th, 2007, 1:55 pm 
Offline

Joined: November 9th, 2004, 10:35 am
Posts: 49
Location: Canterbury UK
Thanks for the replies.

I am using an Access db and the problem still remains.

var records = mydb.ExecuteSQL("SELECT * FROM TelLog ORDER BY tel_RecNo DESC Limit 10,50")

Any further ideas?

_________________
Andy
Hayward Design
E: andy@hayward-design.co.uk
T: 01227 721864

Opus Professional Version v6.00
Build Date Jun 18 2007 15:01:07
Windows XP Professional - Build 2600 Service Pack 2
Total Memory 1024 Mb
DirectX Version 9.0 or better
AMD Athlon


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 6th, 2007, 8:51 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Andy,

Access doesn't use the Limit command as far as I know. You could try using the TOP command as:

SELECT TOP 5 column1, column2, dt FROM table ORDER BY dt DESC

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 7th, 2007, 11:54 am 
Offline

Joined: November 9th, 2004, 10:35 am
Posts: 49
Location: Canterbury UK
RESOLVED

Thanks Mack, must brush up on my Access syntax - more used to MySql.

_________________
Andy
Hayward Design
E: andy@hayward-design.co.uk
T: 01227 721864

Opus Professional Version v6.00
Build Date Jun 18 2007 15:01:07
Windows XP Professional - Build 2600 Service Pack 2
Total Memory 1024 Mb
DirectX Version 9.0 or better
AMD Athlon


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 56 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group