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
Bharat Bhushan
NA
176
158.6k
Help in Sql Query
Aug 8 2011 7:46 AM
hello there,
i m attaching the image with data records. Actually , i need the result like
CLICK HERE
total correct answer and total incorrect answer [your_result)]according date-wise.
like current date,
with last two previous date,
with weekly records
with monthly records ....
hope you can understand my requirement
and following qurey which i was tryin also have a look it at but still not achieved what i need to achieved.
SELECT distinct c.date, c.correct_answer,i.incorrect_answer, ABS(c.correct_answer - i.incorrect_answer) AS result
FROM (SELECT distinct CONVERT(varchar(12), date, 110) AS date, COUNT(your_result) AS correct_answer
FROM tb_mathamatics
WHERE (topic = 'addition_1') AND (your_result = 'correct')
GROUP BY CONVERT(varchar(12), date, 110)
) AS c CROSS JOIN
(SELECT distinct CONVERT(varchar(12), date, 110) AS date, COUNT(your_result) AS incorrect_answer
FROM tb_mathamatics AS tb_mathamatics_1
WHERE (topic = 'addition_1') AND (your_result = 'incorrect')
GROUP BY CONVERT(varchar(12), date, 110)
) AS i
Reply
Answers (
1
)
DateAdd function in store procedure...
How to do grouping in Sqlserver reporting services