Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21843

VB6 SQL question

$
0
0
Hi all,

I have a program written in VB6 and using DAO to talk to the access backend.

Basically, i have a data field with a whole plethora of numbers such RD2-121, RD2-122 and RD2-123 etc, i need a query to extract the next available number. For example, if RD2-123 was the last record, the query would generate RD2-124

Here is a query which works in access 2007 and is exactly what i am looking for.

SELECT MAX(clng(RIGHT(id, len(id) - instr(id, '-')))) + 1 FROM Table1 WHERE id like 'RD2-*'

What would be the VB6 equivqlent of this quer? I get a mismatch error when i just run query in VB6?

Any help would be greatly appreciated

Cheers

Viewing all articles
Browse latest Browse all 21843

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>