Click here to Skip to main content
15,122,845 members
Home / Discussions / Database
   

Database

 
AnswerRe: Array Issue Pin
jkirkerx28-Oct-21 10:04
professionaljkirkerx28-Oct-21 10:04 
QuestionLooking for feedback and contributions to database project Pin Pin
Michael Sydney Balloni17-Oct-21 14:06
professionalMichael Sydney Balloni17-Oct-21 14:06 
QuestionHow to write stored procedure in mysql workbench. SELECT, INSERT, UPDATE,DELETE Pin
Member 1539388914-Oct-21 1:05
MemberMember 1539388914-Oct-21 1:05 
AnswerRe: How to write stored procedure in mysql workbench. SELECT, INSERT, UPDATE,DELETE Pin
Richard MacCutchan14-Oct-21 1:33
mveRichard MacCutchan14-Oct-21 1:33 
AnswerRe: How to write stored procedure in mysql workbench. SELECT, INSERT, UPDATE,DELETE Pin
CHill6022-Oct-21 1:08
mveCHill6022-Oct-21 1:08 
Questionremove Pin
Member 1489067811-Oct-21 21:23
MemberMember 1489067811-Oct-21 21:23 
AnswerRe: Sql Match Pin
OriginalGriff11-Oct-21 21:24
mveOriginalGriff11-Oct-21 21:24 
Question[Resolved] Need Help with this SQL Statement Pin
crmfghtr5-Oct-21 15:24
Membercrmfghtr5-Oct-21 15:24 
<pre lang="VB">Dim strSql As String = "SELECT DISTINCT Orders.OrderId, Orders.ClientId, OrderDate, DueDate, SubTotal, SalesTax, CityTax, LaborTax, Discount, Delivery, OrderTotal,
OrderDetails.ItemId, OrderDetails.Category, OrderDetails.Description, OrderDetails.Qnty, OrderDetails.Unit, OrderDetails.RetailPrice, OrderDetails.Total, (Select MIN (OrderPymts.PrevBal)) As PrevBal, (Select MAX(OrderPymts.PaymentDate)) As PaymentDate,
(Select MIN (OrderPymts.Payment)) As Payment, (Select MIN (OrderPymts.Balance)) As Balance, OrderPymts.Terms, (Select MAX(OrderPymts.PaymentId)) As PaymentId, Clients.Name,
Clients.Address + ' ' + Clients.City + ', ' + Clients.State + '. ' + Clients.Zip AS ClientsAddress,
'Phone : ' + Clients.Phone + ' Fax : ' + Clients.Fax + ' CellPhone : ' + Clients.CellPhone + ' Email : ' + Clients.Email As ContactInfo, Clients.Since
FROM Orders, Clients
INNER JOIN OrderDetails ON OrderDetails.OrderId = Orders.OrderId
INNER JOIN Clients ON Orders.ClientId = Clients.ClientId
INNER JOIN OrderPymts ON OrderPymts.OrderId = Orders.OrderId
WHERE (Orders.OrderId = @OrderId)"</pre>

I'm having trouble with this statement. This statement is used to call the records in the invoice. Odd since I have 2 records, One with multiple items and only 1 payment and it displays fine. The other record with multiple detail items and multiple payments displays the items twice on the invoice report and shows the first payment record instead of the latest payment record. There are 3 tables, Orders, OrderDetails, and OrderPymts. So I'm trying to query from all three tables based on the orderId.
Any Help would be greatly appreciated.

-- modified 10-Oct-21 22:16pm.
AnswerRe: Need Help with this SQL Statement Pin
Richard Deeming5-Oct-21 22:48
mveRichard Deeming5-Oct-21 22:48 
GeneralRe: Need Help with this SQL Statement Pin
crmfghtr6-Oct-21 3:37
Membercrmfghtr6-Oct-21 3:37 
GeneralRe: Need Help with this SQL Statement Pin
Richard Deeming6-Oct-21 4:36
mveRichard Deeming6-Oct-21 4:36 
GeneralRe: Need Help with this SQL Statement Pin
Eddy Vluggen8-Oct-21 16:23
professionalEddy Vluggen8-Oct-21 16:23 
General[Resolved] Re: Need Help with this SQL Statement Pin
crmfghtr10-Oct-21 17:18
Membercrmfghtr10-Oct-21 17:18 
QuestionImport CSV Problems Pin
Jörgen Andersson3-Oct-21 22:32
professionalJörgen Andersson3-Oct-21 22:32 
AnswerRe: Import CSV Problems Pin
Mycroft Holmes4-Oct-21 13:12
professionalMycroft Holmes4-Oct-21 13:12 
GeneralRe: Import CSV Problems Pin
Jörgen Andersson4-Oct-21 21:24
professionalJörgen Andersson4-Oct-21 21:24 
AnswerRe: Import CSV Problems Pin
CHill604-Oct-21 22:04
mveCHill604-Oct-21 22:04 
GeneralRe: Import CSV Problems Pin
Jörgen Andersson4-Oct-21 22:13
professionalJörgen Andersson4-Oct-21 22:13 
GeneralRe: Import CSV Problems Pin
CHill604-Oct-21 22:34
mveCHill604-Oct-21 22:34 
GeneralRe: Import CSV Problems Pin
Jörgen Andersson4-Oct-21 22:43
professionalJörgen Andersson4-Oct-21 22:43 
GeneralRe: Import CSV Problems Pin
Jörgen Andersson4-Oct-21 23:04
professionalJörgen Andersson4-Oct-21 23:04 
AnswerRe: Import CSV Problems Pin
Richard Deeming4-Oct-21 23:04
mveRichard Deeming4-Oct-21 23:04 
GeneralRe: Import CSV Problems Pin
Jörgen Andersson4-Oct-21 23:11
professionalJörgen Andersson4-Oct-21 23:11 
GeneralRe: Import CSV Problems Pin
Richard Deeming5-Oct-21 0:12
mveRichard Deeming5-Oct-21 0:12 
GeneralRe: Import CSV Problems Pin
Jörgen Andersson5-Oct-21 2:17
professionalJörgen Andersson5-Oct-21 2:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.