OK i've created my database and in my table called "Table1"
i've got the entries of all my data which i imported from and excel sheet but now i've got data entries with the same name like this 0000P,LP Gas,9,6.1,8.9 which i need all of those entries add up and put in a table called "Table2"...
What i've done so far is i export my data from an pervasive database to excell but now i need to caculate the sum of all the duplicate entries and export that to excel so that i will only give me the customer number the name and the sum of all the stuff he brought for the specific month.
Is there a way with a SQL query to add the duplicate entries in two tables together so that the entries that have more then one value only give me one value but all of them added together
Thanx For all your help and i learned alot from you guys I will recomend this site to all my programming friends
You guys ROCK BIG TIME and i specially want to thank mirtheil for all the help and we will talk again of not in this life time then in the after life
Enjoy the rest of the night or...
OK so my line of code is right and Date is only in the historylines table but there where is specified the CustomerMaster.Number and The CustomerMaster.Description that data comes from the historylines table and not from the customermaster table like i specified
I modified it like this but it only gives me the data from one table:
mysql = "Select CustomerMaster.Number,CustomerMaster.Description,Date from CustomerMaster,HistoryLines where " & Chr$(34) & "Date" & Chr$(34) & " Between '" + txtFrom(0).Text + "' And '" + txtTo(0).Text + "' And...
OK I could do that but then I loose my date query because i need that line of code you gave me to be altered in away so that it pulls that data out between two dates and two tables.
Ok what I want to do is I want to export data from two tables into one excel sheet but the tables have the same name and what i want is to export the information from the tables where the customer number is the same it must put the number and name from one table and the cash data from the other...
Ok I understand but what if you want to compare two of the fields and if the data is the same export that data to excel because both of my tables have a customernumber field and when i export the data it puts the customer name and product name out but the customer name have the same product name.
Thanx mirtheil your the man and then just one other thing if i want to import two tables of data but both tables have a field with the same name how do i go to work then because the guy that i'm doing this program for just told me that he wants both tables on one excel sheet.
Ok I think I fixed my problem but when I run my program and enter the two dates there is no data being imported to excel.
this is how my line of code looks now and sql execute this with no problem and in my PCC it also display no data
mysql = "Select...
I think i fixed it can you just check this line because it works but it returns no data to excel:
mysql = "Select CustomerCode,DocumentNumber,InclusivePrice,Qty,Description from HistoryLines Where '" & Chr$(34) & "[Date]" & Chr$(34) & "' Between '" + txtFrom.Text + "' And '" + txtTo.Text + "'
OK i understand how it uses the dates but i want to design a macro that would ask you to enter two different dates and then display the data which is in the range of that two dates and i want to do it with a macro because a macro starts up every time you run that excel sheet because that sheet...
Ok I've tried all the ways you can enter a date and it still tels me Invalid date,time or timestamp and I've tried them like this 01/12/2004 to 31/12/2004 and like 12/01/2004 to 12/31/2004 and like this 2004/12/01 to 2004/12/01 and the other way around.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.