|
-
Jan 10th, 2006, 09:32 PM
#1
[RESOLVED] SQL Statement for saleable items
Hi experts!!!!
I have a simple question on sql statement using MS Access query. I want to develop a parameter query that will prompt the user to input for beginning and ending date..Then this query will also display the 5 most saleable products based from the dates inputted.I am developing an inventory database. This query is bound to Order Details table.
Thanks.....
-
Jan 11th, 2006, 10:43 AM
#2
Frenzied Member
Re: SQL Statement for saleable items
Something like:
SELECT TOP 5 fldProduct FROM [Order Details]
WHERE fldDate >= [Enter start date]
AND fldDate <= [Enter end date]
ORDER BY fldSaleable
You might have to modify this if you're running this in code instead of creating a query in the query pane (for example, surround dates with #'s). It also assumes you have a (probably numeric) field called fldSaleable. Otherwise you'll have to figure out another way to rank saleable products.
The text between the []'s for start and end date will prompt the user for dates (or you could get them from a form instead). The table name is in []'s because it's two words; it's not a parameter.
Tengo mas preguntas que contestas
-
Jan 11th, 2006, 10:57 AM
#3
Re: SQL Statement for saleable items
If you date fields have the time with the date then you need to add 1 day to the EdnDate so it will cover all records up to 11:59 on the desired end date.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 12th, 2006, 02:57 AM
#4
-
Jan 14th, 2006, 10:59 AM
#5
Re: SQL Statement for saleable items
Hi to all!!!
Any ideas on this???
-
Jan 17th, 2006, 01:35 AM
#6
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|