TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
mohammed shamsheer
NA
394
144.4k
sql select statement error
Mar 11 2015 8:11 AM
SELECT Date,MIN(VchNo) +'-'+MAX(VchNo) as VchNos--, Form,[VAT %],SUM(TaxableValue) as TaxableValue,SUM(TotalVAT) as TotalVAT,SUM(Total) as Total
FROM (
SELECT CONVERT(varchar(10), InvTransactionMaster.TransactionDate, 105) AS Date,
InvTransactionMaster.VoucherPrefix + ' ' + CAST(InvTransactionMaster.VoucherNumber AS varchar) AS VchNo,
InvTransactionMaster.VoucherType + ' ' + InvTransactionMaster.VoucherForm AS Form, InvTransactionDetails.VatPercentage AS [VAT %],
SUM(InvTransactionDetails.NetValue) AS [TaxableValue], SUM(InvTransactionDetails.TotalVatAmount) AS [TotalVAT],
SUM(InvTransactionDetails.NetValue + InvTransactionDetails.TotalVatAmount) AS Total
FROM InvTransactionDetails INNER JOIN
InvTransactionMaster ON InvTransactionDetails.InvTransactionMasterID = InvTransactionMaster.InvTransactionMasterID
WHERE InvTransactionMaster.IsActive =1
AND InvTransactionMaster.VoucherType ='SI'
AND InvTransactionMaster.BranchID=1--@BranchID
AND InvTransactionDetails.BranchID=1--@BranchID
AND InvTransactionMaster.TransactionDate BETWEEN '2015-02-06' and '2015-02-07'--@FromDate AND @ToDate
--AND (@VATPerc=-1 OR InvTransactionDetails.VatPercentage =@VATPerc)
GROUP BY InvTransactionMaster.TransactionDate,
InvTransactionMaster.VoucherPrefix, InvTransactionMaster.VoucherNumber, InvTransactionMaster.VoucherType, InvTransactionMaster.VoucherForm,
InvTransactionDetails.VatPercentage
) AAA GROUP BY AAA.Date,AAA.Form,AAA.[VAT %] ORDER BY AAA.Date
-------------------
this is my query ....every thing fine but for a particular date it showing some error ...any body have any idea....i give the all the details....
Reply
Answers (
1
)
Update query for Mysql
Code Injection