Valhalla Legends Forums Archive | Visual Basic Programming | Visual Basic w/ SQL

AuthorMessageTime
Slaughter
I'm using M$ SQL and Visual Basic - I've been able to generate reports from SQL statements using VB, but I cannot get SQL to grab certain things from the database and place them in a specified order - I've read tons of SQL stuff, and this still boggles me; I am grabbing data from a SQL database and generating a M$ Excel spreadsheet - I'm trying to grab data based and order it accordingly from least to greatest - I've tried grabbing all the data and "ORDER BY <insert w/e here> DESC" as well as "ASC" help! I can't get it to work correctly..
December 3, 2004, 10:04 PM
R.a.B.B.i.T
Have you tried using LIMIT to maybe 5?  I've found that helps when I debug MySQL routines in PHP.  Also I find it works best to use ORDER BY with numbers, although it works with strings, I don't like it, and I'm not sure if this helps you (since M$SQL sucks, simply because it's by Microsoft).

[/think out loud]
December 4, 2004, 5:16 AM
Slaughter
Yes, I agree M$ SQL Sucks! But thats what most of the program uses, so I have to stick with it :( Got the job dropped on me half way through the project - No, I haven't tried limit... hmm There are several pieces of info I have to grab - Names, Dollar Amounts, according to Dates, and from the largest Dollar Amount down. So in essense I grab a company name & ID as well as the Annual Revenue dollar amount, according to which dates are selected; i.e. dates between 1/01/03 - 1/30/03 and then write them in order from Highest Dollar amount to lowest. It's really pissing me off, and I'm not very experienced with SQL - I started learning it for this project, and this is the first snag I've hit. Thanks for the reply and suggestion rabbit
December 4, 2004, 5:15 PM
St0rm.iD
Yeah man. PHP and mySQL is a far easier, more scalable, more profitable, more secure, and more supported platform that that god damn Microsoft crap.
December 5, 2004, 1:54 AM
Slaughter
No other suggestions as to how to solve the problem?
December 5, 2004, 6:18 PM
Adron
[quote author=Banana fanna fo fanna link=topic=9767.msg91082#msg91082 date=1102211681]
Yeah man. PHP and mySQL is a far easier, more scalable, more profitable, more secure, and more supported platform that that god damn Microsoft crap.
[/quote]

I don't know if I'd say mySQL is more scalable, more profitable or more secure...
December 5, 2004, 6:53 PM
kamakazie
[quote author=Slaughter link=topic=9767.msg91136#msg91136 date=1102270680]
No other suggestions as to how to solve the problem?
[/quote]

How about an example query string?
December 5, 2004, 7:03 PM
St0rm.iD
[quote author=Adron link=topic=9767.msg91138#msg91138 date=1102272798]
[quote author=Banana fanna fo fanna link=topic=9767.msg91082#msg91082 date=1102211681]
Yeah man. PHP and mySQL is a far easier, more scalable, more profitable, more secure, and more supported platform that that god damn Microsoft crap.
[/quote]

I don't know if I'd say mySQL is more scalable, more profitable or more secure...
[/quote]

Guess I wasn't being sarcastic enough.
December 5, 2004, 7:35 PM
Adron
Ah. It may be easier and more supported though. I don't think MSSQL runs on nearly as many platforms as MySQL supports?
December 5, 2004, 8:17 PM
R.a.B.B.i.T
It runs on..err..Windows.

I have no idea now MSQL works, and I've read that it's different from mySQL in many ways, so I don't really know how to help you, sorry.
December 6, 2004, 12:52 AM
Grok
Interesting topic to me, VB w/SQL, so I took a peek only to see you slamming MSSQL without really having a clue about its architecture or operations.  You barely know how to do a simple SELECT with an ORDER BY clause yet think you are qualified to denegrate an incredible RDBMS engine.  At the same time you want help to get it working on a Microsoft platform, using Microsoft Visual Basic, and other Microsoft components.

Still, I will help you.  Tell me a specific query that is returning results in the wrong order.  Show me the source code where you build the query, open the recordset, and how you display the results in your output (GUI?).  What is the backend, MS SQL Server?
December 7, 2004, 3:48 PM

Search