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
Nel
NA
716
1.1m
Sql statement with "group by" and "having"
Nov 10 2011 6:47 AM
Hi,
Could anybody help me please what's wrong with my SQL statement?
I have three tables in my database. I have a dataset and three tableAdapters and want to write the sql command string for retrieving the data from the database with the following requirements:
string comstring="SELECT NOVI.GBR, NOVI.AB, NALOG1.DATA, Min(NALOG1.POCKM) AS MinOfPOCKM, Max(NALOG1.KRAJKM) AS MaxOfKRAJKM, (Max(NALOG1.KRAJKM)-Min(NALOG1.POCKM)) AS RAZLIKA FROM (NALOG1 INNER JOIN MAGACIN ON NALOG1.GBRV=MAGACIN.GBR) INNER JOIN NOVI ON NALOG1.GBRV=NOVI.GBR GROUP BY NOVI.GBR, NOVI.AB, NALOG1.DATA
HAVING (((NOVI.GBR)>="1081" And (NOVI.GBR)<="1149") AND ((NOVI.AB)="1") AND ((NALOG1.DATA)=#10/31/2011#))";
Thanks in advance.
Reply
Answers (
7
)
C# Methods
Autorun a application