Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
Well. Iam doing a small project in C# - MsAccess-2007 Database. And I wish to
convert the below SQL Query in MS-Access2007. Any guidences will be very much
helpful.

SQL
select * from
(select row_number() over(partition by bill_no,bill_type order by line_no) as rn,* from billmst) t where t.rn = 1


The above query useful to select an each single row by bill_no from various bill details in billmst

Thanks for the helps
Posted
Comments
Herman<T>.Instance 17-Nov-14 11:21am    
If each bill has a unique bill_no, then all rows would be returned as result. Or do you keep sending over order to the same custmer with the same bill_no?
Herman<T>.Instance 17-Nov-14 11:23am    
why not use LocalDB for this project? free, light and you don't have to change your query...

1 solution

Easiest if you have access97 is to open the adp or the medb file and add a view/ query then setup your query and switch to sql view :)
 
Share this answer
 
Comments
Herman<T>.Instance 18-Nov-14 9:10am    
Do you think the part 'select row_number() over(partition by bill_no,bill_type order by line_no)' might be understood then by Access?
Thomas Nielsen - getCore 18-Nov-14 9:13am    
No but there is a pretty good WYSIWYG query editor, just add tables and click to form your query, then base your second on that other query and then switch to sql view and you will let MSAccess write the access sql for you, which is practical

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900