473,397 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

this sql command make me sick

hello everyone...

after several days trying to find the right command.. i have to ask you

people...
this is the deal:
i have two tables related...
the first one is the master, the second the slave...
the first has fields like code, name, department and periodicity of
payment...
the second has the payment data... code, date of payment, amount to
pay...
not every one in the first table has the payment in the same month...
because a few people receives its pay one time in the month, and other
receives payment every two or three months (periodicity of payment)...
my trouble is when i want to see all the payments in one month of the
people from one specific department, because if somebody doesn't get
his payment (different periodicity) i have to see the code and name of
the worker AND the date and amount of payment in blank (in that
case)...
i thing that i must to be a simple LEFT JOIN but it doesn't work in
Access (i have a web asp page with and access database in this case)...

i don't know what to do.. please.. if somebody has some ideas.. i need
it...
thanks..
Enzo..
ps/.. my left join code:
SELECT table1.name, table2.date, table2.amount
FROM table1 LEFT JOIN table2 ON table1.code = table2.code
WHERE (((table1.departm)=53) AND ((table2.date)=#2/15/2006#));

Jun 2 '06 #1
2 1246
enzo wrote:
hello everyone...

after several days trying to find the right command.. i have to ask you

people...
this is the deal:
i have two tables related...
the first one is the master, the second the slave...
the first has fields like code, name, department and periodicity of
payment...
the second has the payment data... code, date of payment, amount to
pay...
not every one in the first table has the payment in the same month...
because a few people receives its pay one time in the month, and other
receives payment every two or three months (periodicity of payment)...
my trouble is when i want to see all the payments in one month of the
people from one specific department, because if somebody doesn't get
his payment (different periodicity) i have to see the code and name of
the worker AND the date and amount of payment in blank (in that
case)...
i thing that i must to be a simple LEFT JOIN but it doesn't work in
Access (i have a web asp page with and access database in this case)...

i don't know what to do.. please.. if somebody has some ideas.. i need
it...
thanks..
Enzo..
ps/.. my left join code:
SELECT table1.name, table2.date, table2.amount
FROM table1 LEFT JOIN table2 ON table1.code = table2.code
WHERE (((table1.departm)=53) AND ((table2.date)=#2/15/2006#));

Is Table2.Date a field that contains date stuffed with Date or does it
contain both date and time stuffed with Now(). If Now'd, you'd need to
check between 2/15/2006 and 2/16/2006. A field with mm/dd/yyyy only has
a time of 00:00:00. You'd only pull in records that were Now'd at
midnight exactly.

If that's not the case...maybe someone else has another solution.
Jun 2 '06 #2
salad <oi*@vinegar.com> wrote in
news:K9**************@newsread3.news.pas.earthlink .net:
enzo wrote:
hello everyone...

after several days trying to find the right command.. i have
to ask you

people...
this is the deal:
i have two tables related...
the first one is the master, the second the slave...
the first has fields like code, name, department and
periodicity of payment...
the second has the payment data... code, date of payment,
amount to pay...
not every one in the first table has the payment in the same
month... because a few people receives its pay one time in
the month, and other receives payment every two or three
months (periodicity of payment)...
my trouble is when i want to see all the payments in one
month of the people from one specific department, because if
somebody doesn't get his payment (different periodicity) i
have to see the code and name of the worker AND the date and
amount of payment in blank (in that case)...
i thing that i must to be a simple LEFT JOIN but it doesn't
work in Access (i have a web asp page with and access
database in this case)...

i don't know what to do.. please.. if somebody has some
ideas.. i need it...
thanks..
Enzo..
ps/.. my left join code:
SELECT table1.name, table2.date, table2.amount
FROM table1 LEFT JOIN table2 ON table1.code = table2.code
WHERE (((table1.departm)=53) AND
((table2.date)=#2/15/2006#));

Is Table2.Date a field that contains date stuffed with Date or
does it contain both date and time stuffed with Now(). If
Now'd, you'd need to check between 2/15/2006 and 2/16/2006. A
field with mm/dd/yyyy only has a time of 00:00:00. You'd only
pull in records that were Now'd at midnight exactly.

If that's not the case...maybe someone else has another
solution.

When you do a left join, you must modify any where clause to
accept a null value in addition to the value you are trying to
match.

WHERE (((table1.departm)=53) AND
((table2.date)=#2/15/2006#) OR Table2.date is null);

--
Bob Quintal

PA is y I've altered my email address.
Jun 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: adfgvx | last post by:
I am looking for a Compiled version of the Sick extension for Python (Windows XP and Python 2.2). Does anyone have one and send it to me ? Thanking you by advance, Bruno
6
by: Michael | last post by:
Hi, I'm fairly new at Python, and have the following code that works but isn't very concise, is there a better way of writing it?? It seems much more lengthy than python code i have read..... :-)...
32
by: Martin Vorbrodt | last post by:
Hi there. Is this code portable between platforms? Is it also 100% standard compliant? #include <iostream> using namespace std; class Point { public: enum COORDS { X = 0, Y, Z }; Point(int...
27
by: geskerrett | last post by:
I am hoping someone can help me solve a bit of a puzzle. We are working on a data file reader and extraction tool for an old MS-DOS accounting system dating back to the mid 80's. In the data...
6
by: allenj | last post by:
DB21085I Instance "md" uses "32" bits and DB2 code release "SQL08012" with level identifier "02030106". Informational tokens are "DB2 v8.1.0.16", "s030508", "MI00048", and FixPak "2". Product is...
15
by: phillip.s.powell | last post by:
<style> div div table tr td a.navbar, div div table tr td font {display: none;} </style> <div class="navigationbar" style="background-color:Black; position: absolute; left:50%; top:127px;...
3
by: enzo | last post by:
hello everyone... after several days trying to find the right command.. i have to ask you people... this is the deal: i have two tables related... the first one is the master, the second...
14
by: ThazKool | last post by:
I want to see if this code works the way it should on a Big-Endian system. Also if anyone has any ideas on how determine this at compile-time so that I use the right decoding or encoding...
0
by: coldboyqn | last post by:
Hi you guy! I am using Visual Web Express 2008 to design a server controls (a component). The control is almost very simple. protected override void RenderContents(HtmlTextWriter writer)...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.