|
Hi,
what is the best way to present a report, showing the dollar value per month for each salesperson in a certain region? Suppose we have Eastern and Western regions. Salesperson Sam, Sammantha, Roger,will
Should I use SSIS package for this purpose, or would a stored proc be able to create this same type of layout?
The report should look like, in an excel spreadsheet:
Region Salesperson Month(Total)
Eastern Sam $1050.00
Roger $100.00
Will $100.00
Total $1250.00
Western Sammantha $2000.00
Total $2000.00
Grand total $3250.00
Any ideas is appreciated!
thanks.
|
|
|
|
|
The UI (report layout) has absolutely NOTHING to do with the database. Use the stored proc to prepare the data for you.
Use the UI (excel or a reporting tool) to do the formatting and layout. You sub/grand totalling should be done in the reporting app, the pretty currency format belongs in the reporting app as well.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello everyone! My name is Emmanuel. Please, I wrote a name dictionary program with visualbasic 6.0 using ms access 2003 as my database. I linked the database with the visual basic program using adodc control. In my system, the application runs fine. But when I installed the application in other systems and tried to run it, an error message will occur saying that the C:\Name dictionary\NameDict.mdb is not a valid path. Please help. Thanks in advance!
|
|
|
|
|
When you install it you must also provide the database file.
Depending on your app either it is a empty file or with some pre-existing data.
The file should installed relative to your code. And I suspect in the same directory is probably going to be best for you.
Then the way you connect must specify that. If you are using ODBC then you need to research the connection string/parameters to discover how to specify the file specifically.
|
|
|
|
|
You are in Switzerland, that is not a 3rd world country (you don't have the excuse that you cannot afford/access .Net tech), why the hell are you developing in VB6, the language is dead and is no longer supported. You should be using VB.Net express which is FREE and supported.
[edit] sorry I seem to be repeating myself [/edit]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I'm fed up of my Ms SQL databases keeps on Disapearing from SMS ,and then keeps on coming back ..it is really frustrating ,is there any other database similar to ms sql which does not have any problem like this?
|
|
|
|
|
Well thats a new one, I have never heard this complaint about SSMS before, I suspect it is your environment rather than SSMS.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
chdboy wrote: I'm fed up of my Ms SQL databases keeps on Disapearing from SMS [..],is there any other database similar to ms sql which does not have any problem like this? The IDE and the Database server are two distinctly different applications. What is dissapearing exactly? The alias as defined in SMS, the database (how? is it simply not visisble in the IDE, or is the actual physical file gone?)
MSAccess doesn't have this problem, but that's hardly a good replacement for Sql Server. Switching db-server will have more impact than simply a different IDE. FWIW, you can always download and use another IDE if you dislike SMS.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Are you using a SQL Express User Instance[^] (AttachDBFilename in your connection string)? These databases will automatically be closed and removed after a period of inactivity, which is why you can't see them in SQL Server Management Studio.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Dear Friends,
I am new to struts2 concept, can any one help me in creating a grid. While displaying the grid it should contain one column which fetches the data from database and another two columns of textfield and dropdown list.
Note:The database connectivity is done with the help of Hibernate
|
|
|
|
|
Wrong forum, you need web development, this is not a database problem.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
This is the error
com.microsoft.sqlserver.jdbc.SQLServerException: The conversion of the nvarchar value '8737383838' overflowed an int column.
I'm putting the value integer into bank account number column.
statement.setString(10,acnotxtfield.getText());
Using prepared Statement.
|
|
|
|
|
the value that you are trying to convert is larger than the int can handle. I would suggest that you change the type to Big Int
int, bigint, smallint, and tinyint (Transact-SQL)[^]
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
|
chdboy wrote: bank account number No, a bank account number IS NOT a number . A number is something you do maths with. But what's the meaning of the sum of two bank account numbers? Consequently, use a textual respresentation, e.g. char(10).
|
|
|
|
|
|
Exactly! Bank account numbers can start with a zero or even contain non-numeric characters.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
We have only numeric bank account numbers .
|
|
|
|
|
But they're still not numbers. As Bernhard said, you can't add two bank account numbers together.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
chdboy wrote: We have only numeric bank account numbers
The fact that they have numeric digits does not make them numbers.
A street address has numeric digits but that doesn't make it a number.
|
|
|
|
|
Hi,
I am getting the following error on MySQL stored procedure but I can't understand the reason! can any help please..
here is the error followed by full code:
[SQL]
IF EXISTS(SELECT visit_id FROM visits WHERE file_no = param_file_no) THEN
BEGIN
SET @param_days_since_last_visit = (DATEDIFF(DATE(NOW()), (SELECT DATE(created_date) FROM visits where file_no = param_file_noorder by created_date DESC LIMIT 1)));
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF EXISTS(SELECT visit_id FROM visits WHERE file_no = param_file_no) THEN
BEGIN
SET' at line 1
full code:
BEGIN
DECLARE param_item_id_v1 int;
DECLARE param_item_id_v2 int;
DECLARE param_file_cutoff_days int;
DECLARE param_days_since_last_visit int;
DECLARE param_account_number BIGINT;
DECLARE param_price_list_id INT;
DECLARE param_v1_fees DOUBLE(11, 5);
DECLARE param_v2_fees DOUBLE(11, 5);
DECLARE param_item_description_v1 VARCHAR(255);
DECLARE param_item_description_v2 VARCHAR(255);
SET param_account_number = (SELECT account_number FROM visits WHERE visit_id = param_visit_id);
SET param_price_list_id = (SELECT price_list_id FROM visits WHERE visit_id = param_visit_id);
SET param_item_id_v1 = (SELECT item_id FROM price_list_items WHERE item_code = param_v1);
SET param_item_description_v1 = (SELECT item_name FROM price_list_items WHERE item_id = param_item_id_v1);
SET param_v1_fees = (SELECT price_list_item_prices.item_price FROM price_list_item_prices INNER JOIN price_list_items ON price_list_item_prices.item_id = price_list_items.item_id WHERE price_list_items.item_code = param_v1 AND price_list_item_prices.price_list_id = param_price_list_id);
SET param_item_id_v2 = (SELECT item_id FROM price_list_items WHERE item_code = param_v2);
SET param_item_description_v2 = (SELECT item_name FROM price_list_items WHERE item_id = param_item_id_v2);
SET param_v2_fees = (SELECT price_list_item_prices.item_price FROM price_list_item_prices INNER JOIN price_list_items ON price_list_item_prices.item_id = price_list_items.item_id WHERE price_list_items.item_code = param_v2 AND price_list_item_prices.price_list_id = param_price_list_id);
SET param_file_cutoff_days = (SELECT system_param_value FROM system_param WHERE system_param_name = 'FILE_CUTOFF_DAYS');
IF EXISTS(SELECT visit_id FROM visits WHERE file_no = param_file_no) THEN
BEGIN
SET param_days_since_last_visit = DATEDIFF(DATE(NOW()), (SELECT DATE(created_date) FROM visits where file_no = param_file_no order by created_date DESC LIMIT 1));
IF (param_days_since_last_visit > param_file_cutoff_days) THEN
BEGIN
INSERT INTO visit_items (file_no, visit_id, account_number, item_id, item_code, item_description, item_amount, created_user) VALUES (param_file_no, param_visit_id, param_account_number, param_item_id_v1, param_v1, param_item_description_v1, param_v1_fees, param_created_user);
END;
ELSE
BEGIN
INSERT INTO visit_items (file_no, visit_id, account_number, item_id, item_code, item_description, item_amount, created_user) VALUES (param_file_no, param_visit_id, param_account_number, param_item_id_v2, param_v2, param_item_description_v2, param_v2_fees, param_created_user);
END;
END IF;
END;
ELSE
BEGIN
INSERT INTO visit_items (file_no, visit_id, account_number, item_id, item_code, item_description, item_amount, created_user) VALUES (param_file_no, param_visit_id, param_account_number, param_item_id_v1, param_v1, param_item_description_v1, param_v1_fees, param_created_user);
END;
END IF;
UPDATE visits SET is_received = TRUE, recieved_user = param_created_user, recieved_date = NOW() WHERE visit_id = param_visit_id;
END
Thanks,
Jassim[^]
Technology News @ www.JassimRahma.com
|
|
|
|
|
Jassim Rahma wrote: param_file_no
I don't see this declared as a variable!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
it's passed as parameters. sorry i forgot to metion it. it's like this:
IN param_file_no int, IN param_visit_id int, IN param_v1 int, IN param_v2 int, IN param_created_user int
so what could be the reason for my problem?!
Technology News @ www.JassimRahma.com
|
|
|
|
|
I cannot immediately see an error so what I would suggest is running each assignment statement outside of the stored procedure noting down the results.
Then use what you have noted down as the input for your exists clause.
Keep working through the code in this manner until you find the error - yes, debugging is tedious however the gold at the end of the rainbow is finding the error.
Good luck
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|