473,396 Members | 1,757 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,396 software developers and data experts.

SQL Statement for limiting the number of detail retrieved in Access 2000?

Hello All,

How do I limit the number of detail records selected in a Master-Detail set using SQL?

I want to select all master records for a date, but only the first 3 records for the details (based on the primary key of the detail record). I've
been trying with "TOP 3", but can't get anywhere. Using Access 2000.

Something like:

SELECT t1.*, TOP 3 t2.*
FROM t1, t2
WHERE (t1.item = t2.item) AND (t1.TrnDate = #09/23/06#)

Any help appreciated,

Hexman
Sep 23 '06 #1
15 1753
Try this: (Or something of the like)

SELECT t1.*, t3.*
FROM t1
INNER JOIN
(SELECT TOP 3 t2.*
FROM t2) t3 ON t1.Item = t3.Item
WHERE (t1.TrnDate = #09/23/06#)

You may even want too use a LEFT OUTER JOIN for this, depends on your
data.

Izzy

Hexman wrote:
Hello All,

How do I limit the number of detail records selected in a Master-Detail set using SQL?

I want to select all master records for a date, but only the first 3 records for the details (based on the primary key of the detail record). I've
been trying with "TOP 3", but can't get anywhere. Using Access 2000.

Something like:

SELECT t1.*, TOP 3 t2.*
FROM t1, t2
WHERE (t1.item = t2.item) AND (t1.TrnDate = #09/23/06#)

Any help appreciated,

Hexman
Sep 23 '06 #2
Izzy,

Thanks for the response. I still can't get it to work, either with Access or SS EE. It generates no error during execution, but doesn't return any
rows. If I take out the "(SELECT TOP 3 t2.* FROM t2)" and change all "t3" references to "t2", it retrieves the rows (except too many of them).

This has me stumped. Any further ideas?

All I want to do is limit the number of rows returned from t2 to be joined with t1.

Thanks,

Hexman
On 23 Sep 2006 16:17:22 -0700, "Izzy" <is************@gmail.comwrote:
>Try this: (Or something of the like)

SELECT t1.*, t3.*
FROM t1
INNER JOIN
(SELECT TOP 3 t2.*
FROM t2) t3 ON t1.Item = t3.Item
WHERE (t1.TrnDate = #09/23/06#)

You may even want too use a LEFT OUTER JOIN for this, depends on your
data.

Izzy

Hexman wrote:
>Hello All,

How do I limit the number of detail records selected in a Master-Detail set using SQL?

I want to select all master records for a date, but only the first 3 records for the details (based on the primary key of the detail record). I've
been trying with "TOP 3", but can't get anywhere. Using Access 2000.

Something like:

SELECT t1.*, TOP 3 t2.*
FROM t1, t2
WHERE (t1.item = t2.item) AND (t1.TrnDate = #09/23/06#)

Any help appreciated,

Hexman
Sep 25 '06 #3
Hexman wrote:
Hello All,

How do I limit the number of detail records selected in a
Master-Detail set using SQL?
>
I want to select all master records for a date, but only the first 3
records for the details (based on the primary key of the detail record).
I've
been trying with "TOP 3", but can't get anywhere. Using Access 2000.

Something like:

SELECT t1.*, TOP 3 t2.*
FROM t1, t2
WHERE (t1.item = t2.item) AND (t1.TrnDate = #09/23/06#)

Any help appreciated,

Hexman
You need to understand what you're doing before you can optimize it :)
Now you're creating a dataset that effectively creates a copy of all
records in t2 for each entry in t1. If you have alot of records, this
will get ouf of hand very quickly (i.e. 2 tables with 1000 records each
will cause 10.000 records in memory this way) So using a join like Izzy
suggested is usually much better.

How about this:

Select *
from t1 inner join t2 on (t1.item=t2.item)
where t1.TrnDate=#09/23/06#
and t2.item in
(select top 3 item from t2)

This should join the 2 tables where the 'item' in the 2 tables match and
the date in t1 is the one specified and the items appear in the top 3 of
t2. There is no sort order given to t2, so results may be unpredictable.
--
Rinze van Huizen
C-Services Holland b.v
Sep 25 '06 #4
Hi

I don't think you're going to be able to do this as the "Top x" clause
is going to limit your resultset to x number of records, not x number
of records for each 'grouping' (i.e. the link between your two tables)
so no matter how you try to link the results of this subquery to your
master table, you're only ever (at best) going to get x records from
the subquery.

Cheers
Martin

Hexman wrote:
Izzy,

Thanks for the response. I still can't get it to work, either with Access or SS EE. It generates no error during execution, but doesn't return any
rows. If I take out the "(SELECT TOP 3 t2.* FROM t2)" and change all "t3" references to "t2", it retrieves the rows (except too many of them).

This has me stumped. Any further ideas?

All I want to do is limit the number of rows returned from t2 to be joined with t1.

Thanks,

Hexman
On 23 Sep 2006 16:17:22 -0700, "Izzy" <is************@gmail.comwrote:
Try this: (Or something of the like)

SELECT t1.*, t3.*
FROM t1
INNER JOIN
(SELECT TOP 3 t2.*
FROM t2) t3 ON t1.Item = t3.Item
WHERE (t1.TrnDate = #09/23/06#)

You may even want too use a LEFT OUTER JOIN for this, depends on your
data.

Izzy

Hexman wrote:
Hello All,

How do I limit the number of detail records selected in a Master-Detail set using SQL?

I want to select all master records for a date, but only the first 3 records for the details (based on the primary key of the detail record). I've
been trying with "TOP 3", but can't get anywhere. Using Access 2000.

Something like:

SELECT t1.*, TOP 3 t2.*
FROM t1, t2
WHERE (t1.item = t2.item) AND (t1.TrnDate = #09/23/06#)

Any help appreciated,

Hexman
Sep 25 '06 #5
Martin is right, this cannot be handled in a query.

This will need to be handled in application code.

The only way this would work in a query is if the only 1 record was
returned by t1.

Izzy
Pritcham wrote:
Hi

I don't think you're going to be able to do this as the "Top x" clause
is going to limit your resultset to x number of records, not x number
of records for each 'grouping' (i.e. the link between your two tables)
so no matter how you try to link the results of this subquery to your
master table, you're only ever (at best) going to get x records from
the subquery.

Cheers
Martin

Hexman wrote:
Izzy,

Thanks for the response. I still can't get it to work, either with Access or SS EE. It generates no error during execution, but doesn't return any
rows. If I take out the "(SELECT TOP 3 t2.* FROM t2)" and change all "t3" references to "t2", it retrieves the rows (except too many of them).

This has me stumped. Any further ideas?

All I want to do is limit the number of rows returned from t2 to be joined with t1.

Thanks,

Hexman
On 23 Sep 2006 16:17:22 -0700, "Izzy" <is************@gmail.comwrote:
>Try this: (Or something of the like)
>
>SELECT t1.*, t3.*
>FROM t1
>INNER JOIN
>(SELECT TOP 3 t2.*
FROM t2) t3 ON t1.Item = t3.Item
>WHERE (t1.TrnDate = #09/23/06#)
>
>You may even want too use a LEFT OUTER JOIN for this, depends on your
>data.
>
>Izzy
>
>Hexman wrote:
>Hello All,
>>
>How do I limit the number of detail records selected in a Master-Detail set using SQL?
>>
>I want to select all master records for a date, but only the first 3 records for the details (based on the primary key of the detail record). I've
>been trying with "TOP 3", but can't get anywhere. Using Access 2000.
>>
>Something like:
>>
>SELECT t1.*, TOP 3 t2.*
>FROM t1, t2
>WHERE (t1.item = t2.item) AND (t1.TrnDate = #09/23/06#)
>>
>Any help appreciated,
>>
>Hexman
Sep 25 '06 #6
Hi Rinze

You're absolutely right - I was trying to think of how to limit the
result set in the detail selection before the join happened and
completely missed the use of IN() along with a subquery. I knew I
should have waiting longer before posting!

As for performance on this - as you say, it sucks! Mainly because, as
far as I understand, it's running the subquery for each and every row
in the resultset.

Having just ran a quick test on a couple of handy tables I have here
(only returning 1500 rows in the end results) and the performance was
way too slow to be acceptable for me so depending on the need I think
I'd probably just do a straight join and then limit the number that I
display client-side (again, depending on the volume of data that's got
to travel the wire and how frequently etc).

Still - at least I can cross "learn something new today" off my TODO
list!

Martin
C-Services Holland b.v. wrote:
Hexman wrote:
Hello All,
>
How do I limit the number of detail records selected in a
Master-Detail set using SQL?
>
I want to select all master records for a date, but only the first 3
records for the details (based on the primary key of the detail record).
I've
been trying with "TOP 3", but can't get anywhere. Using Access 2000.
>
Something like:
>
SELECT t1.*, TOP 3 t2.*
FROM t1, t2
WHERE (t1.item = t2.item) AND (t1.TrnDate = #09/23/06#)
>
Any help appreciated,
>
Hexman

You need to understand what you're doing before you can optimize it :)
Now you're creating a dataset that effectively creates a copy of all
records in t2 for each entry in t1. If you have alot of records, this
will get ouf of hand very quickly (i.e. 2 tables with 1000 records each
will cause 10.000 records in memory this way) So using a join like Izzy
suggested is usually much better.

How about this:

Select *
from t1 inner join t2 on (t1.item=t2.item)
where t1.TrnDate=#09/23/06#
and t2.item in
(select top 3 item from t2)

This should join the 2 tables where the 'item' in the 2 tables match and
the date in t1 is the one specified and the items appear in the top 3 of
t2. There is no sort order given to t2, so results may be unpredictable.
--
Rinze van Huizen
C-Services Holland b.v
Sep 25 '06 #7
OK, I understand.

Can anyone give an code example of what Izzy suggests??

Thanks,

Hexman
On 25 Sep 2006 06:03:29 -0700, "Izzy" <is************@gmail.comwrote:
>Martin is right, this cannot be handled in a query.

This will need to be handled in application code.

The only way this would work in a query is if the only 1 record was
returned by t1.

Izzy
Pritcham wrote:
>Hi

I don't think you're going to be able to do this as the "Top x" clause
is going to limit your resultset to x number of records, not x number
of records for each 'grouping' (i.e. the link between your two tables)
so no matter how you try to link the results of this subquery to your
master table, you're only ever (at best) going to get x records from
the subquery.

Cheers
Martin

Hexman wrote:
Izzy,

Thanks for the response. I still can't get it to work, either with Access or SS EE. It generates no error during execution, but doesn't return any
rows. If I take out the "(SELECT TOP 3 t2.* FROM t2)" and change all "t3" references to "t2", it retrieves the rows (except too many of them).

This has me stumped. Any further ideas?

All I want to do is limit the number of rows returned from t2 to be joined with t1.

Thanks,

Hexman
On 23 Sep 2006 16:17:22 -0700, "Izzy" <is************@gmail.comwrote:

Try this: (Or something of the like)

SELECT t1.*, t3.*
FROM t1
INNER JOIN
(SELECT TOP 3 t2.*
FROM t2) t3 ON t1.Item = t3.Item
WHERE (t1.TrnDate = #09/23/06#)

You may even want too use a LEFT OUTER JOIN for this, depends on your
data.

Izzy

Hexman wrote:
Hello All,

How do I limit the number of detail records selected in a Master-Detail set using SQL?

I want to select all master records for a date, but only the first 3 records for the details (based on the primary key of the detail record). I've
been trying with "TOP 3", but can't get anywhere. Using Access 2000.

Something like:

SELECT t1.*, TOP 3 t2.*
FROM t1, t2
WHERE (t1.item = t2.item) AND (t1.TrnDate = #09/23/06#)

Any help appreciated,

Hexman
Sep 26 '06 #8
yeah but you could easily do it as a correlated subquery

Orders and OrderDetails, ok?

Orders
OrderID CustomerID
1 1
2 2
3 3
4 1
5 2
6 3
7 456
8 443
9 3243
10 32443
11 234324

OrderDetails
1 1
2 1
2 2
2 3
3 1
3 2
3 3
3 4
3 5
3 6
3 7
4 1
4 2
4 3
4 4

THIS IS THE SIMPLE ONE
SELECT Orders.*, OrderDetails.LineItem
FROM Orders INNER JOIN OrderDetails ON Orders.OrderID =
OrderDetails.OrderID
WHERE OrderDetails.LineItem IN (Select Top 3 LineItem FROM OrderDetails
SUBQ WHERE SUBQ.OrderID = OrderDetails.OrderID)
ORDER BY 1, 3,2

THIS IS A RIGHT JOIN THAT WILL SHOW ALL ORDERS; EVEN WITHOUT LINEITEMS
SELECT Orders.OrderID, Orders.CustomerID, OrderDetails.LineItem
FROM Orders LEFT OUTER JOIN
OrderDetails ON Orders.OrderID =
OrderDetails.OrderID
WHERE (OrderDetails.LineItem IN
(SELECT TOP 3 LineItem
FROM OrderDetails AS SUBQ
WHERE (OrderID =
OrderDetails.OrderID))) OR OrderDetails.LineItem IS NULL
ORDER BY Orders.OrderID, OrderDetails.LineItem, Orders.CustomerID

RESULTS
OrderID CustomerID LineItem
1 1 1
2 2 1
2 2 2
2 2 3
3 3 1
3 3 2
3 3 3
4 1 1
4 1 2
4 1 3
5 2 NULL
6 3 NULL
7 456 NULL
8 443 NULL
9 3243 NULL
10 32443 NULL
11 234324 NULL
HTH Dog; let me know if i can help more

-Aaron

Pritcham wrote:
Hi

I don't think you're going to be able to do this as the "Top x" clause
is going to limit your resultset to x number of records, not x number
of records for each 'grouping' (i.e. the link between your two tables)
so no matter how you try to link the results of this subquery to your
master table, you're only ever (at best) going to get x records from
the subquery.

Cheers
Martin

Hexman wrote:
Izzy,

Thanks for the response. I still can't get it to work, either with Access or SS EE. It generates no error during execution, but doesn't return any
rows. If I take out the "(SELECT TOP 3 t2.* FROM t2)" and change all "t3" references to "t2", it retrieves the rows (except too many of them).

This has me stumped. Any further ideas?

All I want to do is limit the number of rows returned from t2 to be joined with t1.

Thanks,

Hexman
On 23 Sep 2006 16:17:22 -0700, "Izzy" <is************@gmail.comwrote:
>Try this: (Or something of the like)
>
>SELECT t1.*, t3.*
>FROM t1
>INNER JOIN
>(SELECT TOP 3 t2.*
FROM t2) t3 ON t1.Item = t3.Item
>WHERE (t1.TrnDate = #09/23/06#)
>
>You may even want too use a LEFT OUTER JOIN for this, depends on your
>data.
>
>Izzy
>
>Hexman wrote:
>Hello All,
>>
>How do I limit the number of detail records selected in a Master-Detail set using SQL?
>>
>I want to select all master records for a date, but only the first 3 records for the details (based on the primary key of the detail record). I've
>been trying with "TOP 3", but can't get anywhere. Using Access 2000.
>>
>Something like:
>>
>SELECT t1.*, TOP 3 t2.*
>FROM t1, t2
>WHERE (t1.item = t2.item) AND (t1.TrnDate = #09/23/06#)
>>
>Any help appreciated,
>>
>Hexman
Sep 26 '06 #9
Nice work Aaron!

Does this solve the problem Hexman?

Izzy
aa*********@gmail.com wrote:
yeah but you could easily do it as a correlated subquery

Orders and OrderDetails, ok?

Orders
OrderID CustomerID
1 1
2 2
3 3
4 1
5 2
6 3
7 456
8 443
9 3243
10 32443
11 234324

OrderDetails
1 1
2 1
2 2
2 3
3 1
3 2
3 3
3 4
3 5
3 6
3 7
4 1
4 2
4 3
4 4

THIS IS THE SIMPLE ONE
SELECT Orders.*, OrderDetails.LineItem
FROM Orders INNER JOIN OrderDetails ON Orders.OrderID =
OrderDetails.OrderID
WHERE OrderDetails.LineItem IN (Select Top 3 LineItem FROM OrderDetails
SUBQ WHERE SUBQ.OrderID = OrderDetails.OrderID)
ORDER BY 1, 3,2

THIS IS A RIGHT JOIN THAT WILL SHOW ALL ORDERS; EVEN WITHOUT LINEITEMS
SELECT Orders.OrderID, Orders.CustomerID, OrderDetails.LineItem
FROM Orders LEFT OUTER JOIN
OrderDetails ON Orders.OrderID =
OrderDetails.OrderID
WHERE (OrderDetails.LineItem IN
(SELECT TOP 3 LineItem
FROM OrderDetails AS SUBQ
WHERE (OrderID =
OrderDetails.OrderID))) OR OrderDetails.LineItem IS NULL
ORDER BY Orders.OrderID, OrderDetails.LineItem, Orders.CustomerID

RESULTS
OrderID CustomerID LineItem
1 1 1
2 2 1
2 2 2
2 2 3
3 3 1
3 3 2
3 3 3
4 1 1
4 1 2
4 1 3
5 2 NULL
6 3 NULL
7 456 NULL
8 443 NULL
9 3243 NULL
10 32443 NULL
11 234324 NULL
HTH Dog; let me know if i can help more

-Aaron

Pritcham wrote:
Hi

I don't think you're going to be able to do this as the "Top x" clause
is going to limit your resultset to x number of records, not x number
of records for each 'grouping' (i.e. the link between your two tables)
so no matter how you try to link the results of this subquery to your
master table, you're only ever (at best) going to get x records from
the subquery.

Cheers
Martin

Hexman wrote:
Izzy,
>
Thanks for the response. I still can't get it to work, either with Access or SS EE. It generates no error during execution, but doesn't return any
rows. If I take out the "(SELECT TOP 3 t2.* FROM t2)" and change all "t3" references to "t2", it retrieves the rows (except too many of them).
>
This has me stumped. Any further ideas?
>
All I want to do is limit the number of rows returned from t2 to be joined with t1.
>
Thanks,
>
Hexman
>
>
On 23 Sep 2006 16:17:22 -0700, "Izzy" <is************@gmail.comwrote:
>
Try this: (Or something of the like)

SELECT t1.*, t3.*
FROM t1
INNER JOIN
(SELECT TOP 3 t2.*
FROM t2) t3 ON t1.Item = t3.Item
WHERE (t1.TrnDate = #09/23/06#)

You may even want too use a LEFT OUTER JOIN for this, depends on your
data.

Izzy

Hexman wrote:
Hello All,
>
How do I limit the number of detail records selected in a Master-Detail set using SQL?
>
I want to select all master records for a date, but only the first 3 records for the details (based on the primary key of the detail record). I've
been trying with "TOP 3", but can't get anywhere. Using Access 2000.
>
Something like:
>
SELECT t1.*, TOP 3 t2.*
FROM t1, t2
WHERE (t1.item = t2.item) AND (t1.TrnDate = #09/23/06#)
>
Any help appreciated,
>
Hexman
Sep 26 '06 #10
since Microsoft blocks all my posts; Izzy might not even be able to see
my post

-Aaron
Izzy wrote:
Nice work Aaron!

Does this solve the problem Hexman?

Izzy
aa*********@gmail.com wrote:
yeah but you could easily do it as a correlated subquery

Orders and OrderDetails, ok?

Orders
OrderID CustomerID
1 1
2 2
3 3
4 1
5 2
6 3
7 456
8 443
9 3243
10 32443
11 234324

OrderDetails
1 1
2 1
2 2
2 3
3 1
3 2
3 3
3 4
3 5
3 6
3 7
4 1
4 2
4 3
4 4

THIS IS THE SIMPLE ONE
SELECT Orders.*, OrderDetails.LineItem
FROM Orders INNER JOIN OrderDetails ON Orders.OrderID =
OrderDetails.OrderID
WHERE OrderDetails.LineItem IN (Select Top 3 LineItem FROM OrderDetails
SUBQ WHERE SUBQ.OrderID = OrderDetails.OrderID)
ORDER BY 1, 3,2

THIS IS A RIGHT JOIN THAT WILL SHOW ALL ORDERS; EVEN WITHOUT LINEITEMS
SELECT Orders.OrderID, Orders.CustomerID, OrderDetails.LineItem
FROM Orders LEFT OUTER JOIN
OrderDetails ON Orders.OrderID =
OrderDetails.OrderID
WHERE (OrderDetails.LineItem IN
(SELECT TOP 3 LineItem
FROM OrderDetails AS SUBQ
WHERE (OrderID =
OrderDetails.OrderID))) OR OrderDetails.LineItem IS NULL
ORDER BY Orders.OrderID, OrderDetails.LineItem, Orders.CustomerID

RESULTS
OrderID CustomerID LineItem
1 1 1
2 2 1
2 2 2
2 2 3
3 3 1
3 3 2
3 3 3
4 1 1
4 1 2
4 1 3
5 2 NULL
6 3 NULL
7 456 NULL
8 443 NULL
9 3243 NULL
10 32443 NULL
11 234324 NULL
HTH Dog; let me know if i can help more

-Aaron

Pritcham wrote:
Hi
>
I don't think you're going to be able to do this as the "Top x" clause
is going to limit your resultset to x number of records, not x number
of records for each 'grouping' (i.e. the link between your two tables)
so no matter how you try to link the results of this subquery to your
master table, you're only ever (at best) going to get x records from
the subquery.
>
Cheers
Martin
>
Hexman wrote:
Izzy,

Thanks for the response. I still can't get it to work, either with Access or SS EE. It generates no error during execution, but doesn't return any
rows. If I take out the "(SELECT TOP 3 t2.* FROM t2)" and change all "t3" references to "t2", it retrieves the rows (except too many of them).

This has me stumped. Any further ideas?

All I want to do is limit the number of rows returned from t2 to be joined with t1.

Thanks,

Hexman


On 23 Sep 2006 16:17:22 -0700, "Izzy" <is************@gmail.comwrote:

>Try this: (Or something of the like)
>
>SELECT t1.*, t3.*
>FROM t1
>INNER JOIN
>(SELECT TOP 3 t2.*
FROM t2) t3 ON t1.Item = t3.Item
>WHERE (t1.TrnDate = #09/23/06#)
>
>You may even want too use a LEFT OUTER JOIN for this, depends on your
>data.
>
>Izzy
>
>Hexman wrote:
>Hello All,
>>
>How do I limit the number of detail records selected in a Master-Detail set using SQL?
>>
>I want to select all master records for a date, but only the first 3 records for the details (based on the primary key of the detail record). I've
>been trying with "TOP 3", but can't get anywhere. Using Access 2000.
>>
>Something like:
>>
>SELECT t1.*, TOP 3 t2.*
>FROM t1, t2
>WHERE (t1.item = t2.item) AND (t1.TrnDate = #09/23/06#)
>>
>Any help appreciated,
>>
>Hexman
Sep 26 '06 #11
Izzy,

Not Quite.

I'm doing this in SS and get this error.

Msg 245, Level 16, State 1, Line 2
Conversion failed when converting the nvarchar value '34101-9 -SS' to data type smallint.

This is an item number (length 22) and its trying to convert to smallint???? I've checked the schema and it appears to be OK.

Here's my code.

use IMaster
select Inven.ActDate, Inven.Item, Inven.Descr, Inven.ProdLn,
Trans.TrnDate, Trans.TrnEffDate, Trans.Dept
from Inven inner join Trans on (Inven.ActDate = Trans.TrnDate and
Inven.Item = Trans.Item and Inven.ProdLn = Trans.ProdLn)
where Trans.TrnEffDate in (select top 3 Trans.TrnEffDate from Trans as subq
where subq.ActDate = Trans.TrnDate and subq.Item = Trans.Item and
subq.ProdLn = Trans.ProdLn)

Any Ideas?

Thanks for your Help,

Hexman


On 26 Sep 2006 07:03:07 -0700, "Izzy" <is************@gmail.comwrote:
>Nice work Aaron!

Does this solve the problem Hexman?

Izzy
aa*********@gmail.com wrote:
>yeah but you could easily do it as a correlated subquery

Orders and OrderDetails, ok?

Orders
OrderID CustomerID
1 1
2 2
3 3
4 1
5 2
6 3
7 456
8 443
9 3243
10 32443
11 234324

OrderDetails
1 1
2 1
2 2
2 3
3 1
3 2
3 3
3 4
3 5
3 6
3 7
4 1
4 2
4 3
4 4

THIS IS THE SIMPLE ONE
SELECT Orders.*, OrderDetails.LineItem
FROM Orders INNER JOIN OrderDetails ON Orders.OrderID =
OrderDetails.OrderID
WHERE OrderDetails.LineItem IN (Select Top 3 LineItem FROM OrderDetails
SUBQ WHERE SUBQ.OrderID = OrderDetails.OrderID)
ORDER BY 1, 3,2

THIS IS A RIGHT JOIN THAT WILL SHOW ALL ORDERS; EVEN WITHOUT LINEITEMS
SELECT Orders.OrderID, Orders.CustomerID, OrderDetails.LineItem
FROM Orders LEFT OUTER JOIN
OrderDetails ON Orders.OrderID =
OrderDetails.OrderID
WHERE (OrderDetails.LineItem IN
(SELECT TOP 3 LineItem
FROM OrderDetails AS SUBQ
WHERE (OrderID =
OrderDetails.OrderID))) OR OrderDetails.LineItem IS NULL
ORDER BY Orders.OrderID, OrderDetails.LineItem, Orders.CustomerID

RESULTS
OrderID CustomerID LineItem
1 1 1
2 2 1
2 2 2
2 2 3
3 3 1
3 3 2
3 3 3
4 1 1
4 1 2
4 1 3
5 2 NULL
6 3 NULL
7 456 NULL
8 443 NULL
9 3243 NULL
10 32443 NULL
11 234324 NULL
HTH Dog; let me know if i can help more

-Aaron

Pritcham wrote:
Hi

I don't think you're going to be able to do this as the "Top x" clause
is going to limit your resultset to x number of records, not x number
of records for each 'grouping' (i.e. the link between your two tables)
so no matter how you try to link the results of this subquery to your
master table, you're only ever (at best) going to get x records from
the subquery.

Cheers
Martin

Hexman wrote:
Izzy,

Thanks for the response. I still can't get it to work, either with Access or SS EE. It generates no error during execution, but doesn't return any
rows. If I take out the "(SELECT TOP 3 t2.* FROM t2)" and change all "t3" references to "t2", it retrieves the rows (except too many of them).

This has me stumped. Any further ideas?

All I want to do is limit the number of rows returned from t2 to be joined with t1.

Thanks,

Hexman
On 23 Sep 2006 16:17:22 -0700, "Izzy" <is************@gmail.comwrote:

Try this: (Or something of the like)

SELECT t1.*, t3.*
FROM t1
INNER JOIN
(SELECT TOP 3 t2.*
FROM t2) t3 ON t1.Item = t3.Item
WHERE (t1.TrnDate = #09/23/06#)

You may even want too use a LEFT OUTER JOIN for this, depends on your
data.

Izzy

Hexman wrote:
Hello All,

How do I limit the number of detail records selected in a Master-Detail set using SQL?

I want to select all master records for a date, but only the first 3 records for the details (based on the primary key of the detail record). I've
been trying with "TOP 3", but can't get anywhere. Using Access 2000.

Something like:

SELECT t1.*, TOP 3 t2.*
FROM t1, t2
WHERE (t1.item = t2.item) AND (t1.TrnDate = #09/23/06#)

Any help appreciated,

Hexman
Sep 27 '06 #12
Hexman

Without knowing your schema it's almost impossible to say what the
issue is but from the sound of the error message it looks like one of
the joins is on two different field types (Inven.Item = Trans.Item as a
guess as you say that '34101-9-SS' is an item number). To diagnose,
check what field that value is held in in your DB, check your SQL
statement and see whether this field is used as part of the join - if
so, what's the field-type it's trying to join to.

HTH
Martin

Hexman wrote:
Izzy,

Not Quite.

I'm doing this in SS and get this error.

Msg 245, Level 16, State 1, Line 2
Conversion failed when converting the nvarchar value '34101-9 -SS' to data type smallint.

This is an item number (length 22) and its trying to convert to smallint???? I've checked the schema and it appears to be OK.

Here's my code.

use IMaster
select Inven.ActDate, Inven.Item, Inven.Descr, Inven.ProdLn,
Trans.TrnDate, Trans.TrnEffDate, Trans.Dept
from Inven inner join Trans on (Inven.ActDate = Trans.TrnDate and
Inven.Item = Trans.Item and Inven.ProdLn = Trans.ProdLn)
where Trans.TrnEffDate in (select top 3 Trans.TrnEffDate from Trans as subq
where subq.ActDate = Trans.TrnDate and subq.Item = Trans.Item and
subq.ProdLn = Trans.ProdLn)

Any Ideas?

Thanks for your Help,

Hexman


On 26 Sep 2006 07:03:07 -0700, "Izzy" <is************@gmail.comwrote:
Nice work Aaron!

Does this solve the problem Hexman?

Izzy
aa*********@gmail.com wrote:
yeah but you could easily do it as a correlated subquery

Orders and OrderDetails, ok?

Orders
OrderID CustomerID
1 1
2 2
3 3
4 1
5 2
6 3
7 456
8 443
9 3243
10 32443
11 234324

OrderDetails
1 1
2 1
2 2
2 3
3 1
3 2
3 3
3 4
3 5
3 6
3 7
4 1
4 2
4 3
4 4

THIS IS THE SIMPLE ONE
SELECT Orders.*, OrderDetails.LineItem
FROM Orders INNER JOIN OrderDetails ON Orders.OrderID =
OrderDetails.OrderID
WHERE OrderDetails.LineItem IN (Select Top 3 LineItem FROM OrderDetails
SUBQ WHERE SUBQ.OrderID = OrderDetails.OrderID)
ORDER BY 1, 3,2

THIS IS A RIGHT JOIN THAT WILL SHOW ALL ORDERS; EVEN WITHOUT LINEITEMS
SELECT Orders.OrderID, Orders.CustomerID, OrderDetails.LineItem
FROM Orders LEFT OUTER JOIN
OrderDetails ON Orders.OrderID =
OrderDetails.OrderID
WHERE (OrderDetails.LineItem IN
(SELECT TOP 3 LineItem
FROM OrderDetails AS SUBQ
WHERE (OrderID =
OrderDetails.OrderID))) OR OrderDetails.LineItem IS NULL
ORDER BY Orders.OrderID, OrderDetails.LineItem, Orders.CustomerID

RESULTS
OrderID CustomerID LineItem
1 1 1
2 2 1
2 2 2
2 2 3
3 3 1
3 3 2
3 3 3
4 1 1
4 1 2
4 1 3
5 2 NULL
6 3 NULL
7 456 NULL
8 443 NULL
9 3243 NULL
10 32443 NULL
11 234324 NULL
HTH Dog; let me know if i can help more

-Aaron

Pritcham wrote:
Hi

I don't think you're going to be able to do this as the "Top x" clause
is going to limit your resultset to x number of records, not x number
of records for each 'grouping' (i.e. the link between your two tables)
so no matter how you try to link the results of this subquery to your
master table, you're only ever (at best) going to get x records from
the subquery.

Cheers
Martin

Hexman wrote:
Izzy,
>
Thanks for the response. I still can't get it to work, either with Access or SS EE. It generates no error during execution, but doesn't return any
rows. If I take out the "(SELECT TOP 3 t2.* FROM t2)" and change all "t3" references to "t2", it retrieves the rows (except too many of them).
>
This has me stumped. Any further ideas?
>
All I want to do is limit the number of rows returned from t2 to be joined with t1.
>
Thanks,
>
Hexman
>
>
On 23 Sep 2006 16:17:22 -0700, "Izzy" <is************@gmail.comwrote:
>
Try this: (Or something of the like)

SELECT t1.*, t3.*
FROM t1
INNER JOIN
(SELECT TOP 3 t2.*
FROM t2) t3 ON t1.Item = t3.Item
WHERE (t1.TrnDate = #09/23/06#)

You may even want too use a LEFT OUTER JOIN for this, depends on your
data.

Izzy

Hexman wrote:
Hello All,
>
How do I limit the number of detail records selected in a Master-Detail set using SQL?
>
I want to select all master records for a date, but only the first 3 records for the details (based on the primary key of the detail record). I've
been trying with "TOP 3", but can't get anywhere. Using Access 2000.
>
Something like:
>
SELECT t1.*, TOP 3 t2.*
FROM t1, t2
WHERE (t1.item = t2.item) AND (t1.TrnDate = #09/23/06#)
>
Any help appreciated,
>
Hexman
Sep 27 '06 #13
you can take the subquery; drop the correlated part-- where you're
binding the subquery to the parent query.. and test it.

then test the parent query.

shit you can do this all in design view in either microsoft Access Data
Projects or SQL Server Management Studio

-Aaron

Pritcham wrote:
Hexman

Without knowing your schema it's almost impossible to say what the
issue is but from the sound of the error message it looks like one of
the joins is on two different field types (Inven.Item = Trans.Item as a
guess as you say that '34101-9-SS' is an item number). To diagnose,
check what field that value is held in in your DB, check your SQL
statement and see whether this field is used as part of the join - if
so, what's the field-type it's trying to join to.

HTH
Martin

Hexman wrote:
Izzy,

Not Quite.

I'm doing this in SS and get this error.

Msg 245, Level 16, State 1, Line 2
Conversion failed when converting the nvarchar value '34101-9 -SS' to data type smallint.

This is an item number (length 22) and its trying to convert to smallint???? I've checked the schema and it appears to be OK.

Here's my code.

use IMaster
select Inven.ActDate, Inven.Item, Inven.Descr, Inven.ProdLn,
Trans.TrnDate, Trans.TrnEffDate, Trans.Dept
from Inven inner join Trans on (Inven.ActDate = Trans.TrnDate and
Inven.Item = Trans.Item and Inven.ProdLn = Trans.ProdLn)
where Trans.TrnEffDate in (select top 3 Trans.TrnEffDate from Trans as subq
where subq.ActDate = Trans.TrnDate and subq.Item = Trans.Item and
subq.ProdLn = Trans.ProdLn)

Any Ideas?

Thanks for your Help,

Hexman


On 26 Sep 2006 07:03:07 -0700, "Izzy" <is************@gmail.comwrote:
>Nice work Aaron!
>
>Does this solve the problem Hexman?
>
>Izzy
>
>
>aa*********@gmail.com wrote:
>yeah but you could easily do it as a correlated subquery
>>
>Orders and OrderDetails, ok?
>>
>Orders
>OrderID CustomerID
>1 1
>2 2
>3 3
>4 1
>5 2
>6 3
>7 456
>8 443
>9 3243
>10 32443
>11 234324
>>
>OrderDetails
>1 1
>2 1
>2 2
>2 3
>3 1
>3 2
>3 3
>3 4
>3 5
>3 6
>3 7
>4 1
>4 2
>4 3
>4 4
>>
>THIS IS THE SIMPLE ONE
>SELECT Orders.*, OrderDetails.LineItem
>FROM Orders INNER JOIN OrderDetails ON Orders.OrderID =
>OrderDetails.OrderID
>WHERE OrderDetails.LineItem IN (Select Top 3 LineItem FROM OrderDetails
>SUBQ WHERE SUBQ.OrderID = OrderDetails.OrderID)
>ORDER BY 1, 3,2
>>
>THIS IS A RIGHT JOIN THAT WILL SHOW ALL ORDERS; EVEN WITHOUT LINEITEMS
>SELECT Orders.OrderID, Orders.CustomerID, OrderDetails.LineItem
>FROM Orders LEFT OUTER JOIN
> OrderDetails ON Orders.OrderID =
>OrderDetails.OrderID
>WHERE (OrderDetails.LineItem IN
> (SELECT TOP 3 LineItem
> FROM OrderDetails AS SUBQ
> WHERE (OrderID =
>OrderDetails.OrderID))) OR OrderDetails.LineItem IS NULL
>ORDER BY Orders.OrderID, OrderDetails.LineItem, Orders.CustomerID
>>
>RESULTS
>OrderID CustomerID LineItem
>1 1 1
>2 2 1
>2 2 2
>2 2 3
>3 3 1
>3 3 2
>3 3 3
>4 1 1
>4 1 2
>4 1 3
>5 2 NULL
>6 3 NULL
>7 456 NULL
>8 443 NULL
>9 3243 NULL
>10 32443 NULL
>11 234324 NULL
>>
>>
>HTH Dog; let me know if i can help more
>>
>-Aaron
>>
>>
>>
>Pritcham wrote:
Hi
>
I don't think you're going to be able to do this as the "Top x" clause
is going to limit your resultset to x number of records, not x number
of records for each 'grouping' (i.e. the link between your two tables)
so no matter how you try to link the results of this subquery to your
master table, you're only ever (at best) going to get x records from
the subquery.
>
Cheers
Martin
>
Hexman wrote:
Izzy,
>
Thanks for the response. I still can't get it to work, either with Access or SS EE. It generates no error during execution, but doesn't return any
rows. If I take out the "(SELECT TOP 3 t2.* FROM t2)" and change all "t3" references to "t2", it retrieves the rows (except too many of them).
>
This has me stumped. Any further ideas?
>
All I want to do is limit the number of rows returned from t2 to be joined with t1.
>
Thanks,
>
Hexman
>
>
On 23 Sep 2006 16:17:22 -0700, "Izzy" <is************@gmail.comwrote:
>
Try this: (Or something of the like)

SELECT t1.*, t3.*
FROM t1
INNER JOIN
(SELECT TOP 3 t2.*
FROM t2) t3 ON t1.Item = t3.Item
WHERE (t1.TrnDate = #09/23/06#)

You may even want too use a LEFT OUTER JOIN for this, depends on your
data.

Izzy

Hexman wrote:
Hello All,
>
How do I limit the number of detail records selected in a Master-Detail set using SQL?
>
I want to select all master records for a date, but only the first 3 records for the details (based on the primary key of the detail record). I've
been trying with "TOP 3", but can't get anywhere. Using Access 2000.
>
Something like:
>
SELECT t1.*, TOP 3 t2.*
FROM t1, t2
WHERE (t1.item = t2.item) AND (t1.TrnDate = #09/23/06#)
>
Any help appreciated,
>
Hexman
Sep 27 '06 #14
Heck, I found the error (my typo, the eyes, the eyes!!!). Works well under SS 2005 EE. Extremely long running under Access.

I thank all who have contributed.

Hexman

On 27 Sep 2006 05:13:52 -0700, "Pritcham" <do******************@hotmail.comwrote:
>Hexman

Without knowing your schema it's almost impossible to say what the
issue is but from the sound of the error message it looks like one of
the joins is on two different field types (Inven.Item = Trans.Item as a
guess as you say that '34101-9-SS' is an item number). To diagnose,
check what field that value is held in in your DB, check your SQL
statement and see whether this field is used as part of the join - if
so, what's the field-type it's trying to join to.

HTH
Martin

Hexman wrote:
>Izzy,

Not Quite.

I'm doing this in SS and get this error.

Msg 245, Level 16, State 1, Line 2
Conversion failed when converting the nvarchar value '34101-9 -SS' to data type smallint.

This is an item number (length 22) and its trying to convert to smallint???? I've checked the schema and it appears to be OK.

Here's my code.

use IMaster
select Inven.ActDate, Inven.Item, Inven.Descr, Inven.ProdLn,
Trans.TrnDate, Trans.TrnEffDate, Trans.Dept
from Inven inner join Trans on (Inven.ActDate = Trans.TrnDate and
Inven.Item = Trans.Item and Inven.ProdLn = Trans.ProdLn)
where Trans.TrnEffDate in (select top 3 Trans.TrnEffDate from Trans as subq
where subq.ActDate = Trans.TrnDate and subq.Item = Trans.Item and
subq.ProdLn = Trans.ProdLn)

Any Ideas?

Thanks for your Help,

Hexman


On 26 Sep 2006 07:03:07 -0700, "Izzy" <is************@gmail.comwrote:
>Nice work Aaron!

Does this solve the problem Hexman?

Izzy
aa*********@gmail.com wrote:
yeah but you could easily do it as a correlated subquery

Orders and OrderDetails, ok?

Orders
OrderID CustomerID
1 1
2 2
3 3
4 1
5 2
6 3
7 456
8 443
9 3243
10 32443
11 234324

OrderDetails
1 1
2 1
2 2
2 3
3 1
3 2
3 3
3 4
3 5
3 6
3 7
4 1
4 2
4 3
4 4

THIS IS THE SIMPLE ONE
SELECT Orders.*, OrderDetails.LineItem
FROM Orders INNER JOIN OrderDetails ON Orders.OrderID =
OrderDetails.OrderID
WHERE OrderDetails.LineItem IN (Select Top 3 LineItem FROM OrderDetails
SUBQ WHERE SUBQ.OrderID = OrderDetails.OrderID)
ORDER BY 1, 3,2

THIS IS A RIGHT JOIN THAT WILL SHOW ALL ORDERS; EVEN WITHOUT LINEITEMS
SELECT Orders.OrderID, Orders.CustomerID, OrderDetails.LineItem
FROM Orders LEFT OUTER JOIN
OrderDetails ON Orders.OrderID =
OrderDetails.OrderID
WHERE (OrderDetails.LineItem IN
(SELECT TOP 3 LineItem
FROM OrderDetails AS SUBQ
WHERE (OrderID =
OrderDetails.OrderID))) OR OrderDetails.LineItem IS NULL
ORDER BY Orders.OrderID, OrderDetails.LineItem, Orders.CustomerID

RESULTS
OrderID CustomerID LineItem
1 1 1
2 2 1
2 2 2
2 2 3
3 3 1
3 3 2
3 3 3
4 1 1
4 1 2
4 1 3
5 2 NULL
6 3 NULL
7 456 NULL
8 443 NULL
9 3243 NULL
10 32443 NULL
11 234324 NULL
HTH Dog; let me know if i can help more

-Aaron

Pritcham wrote:
Hi

I don't think you're going to be able to do this as the "Top x" clause
is going to limit your resultset to x number of records, not x number
of records for each 'grouping' (i.e. the link between your two tables)
so no matter how you try to link the results of this subquery to your
master table, you're only ever (at best) going to get x records from
the subquery.

Cheers
Martin

Hexman wrote:
Izzy,

Thanks for the response. I still can't get it to work, either with Access or SS EE. It generates no error during execution, but doesn't return any
rows. If I take out the "(SELECT TOP 3 t2.* FROM t2)" and change all "t3" references to "t2", it retrieves the rows (except too many of them).

This has me stumped. Any further ideas?

All I want to do is limit the number of rows returned from t2 to be joined with t1.

Thanks,

Hexman
On 23 Sep 2006 16:17:22 -0700, "Izzy" <is************@gmail.comwrote:

Try this: (Or something of the like)

SELECT t1.*, t3.*
FROM t1
INNER JOIN
(SELECT TOP 3 t2.*
FROM t2) t3 ON t1.Item = t3.Item
WHERE (t1.TrnDate = #09/23/06#)

You may even want too use a LEFT OUTER JOIN for this, depends on your
data.

Izzy

Hexman wrote:
Hello All,

How do I limit the number of detail records selected in a Master-Detail set using SQL?

I want to select all master records for a date, but only the first 3 records for the details (based on the primary key of the detail record). I've
been trying with "TOP 3", but can't get anywhere. Using Access 2000.

Something like:

SELECT t1.*, TOP 3 t2.*
FROM t1, t2
WHERE (t1.item = t2.item) AND (t1.TrnDate = #09/23/06#)

Any help appreciated,

Hexman
Sep 28 '06 #15
Access MDB?

Access MDB is completely obsolete
use Access Data Projects; avoid the headaches!

-Aaron
Hexman wrote:
Heck, I found the error (my typo, the eyes, the eyes!!!). Works well under SS 2005 EE. Extremely long running under Access.

I thank all who have contributed.

Hexman

On 27 Sep 2006 05:13:52 -0700, "Pritcham" <do******************@hotmail.comwrote:
Hexman

Without knowing your schema it's almost impossible to say what the
issue is but from the sound of the error message it looks like one of
the joins is on two different field types (Inven.Item = Trans.Item as a
guess as you say that '34101-9-SS' is an item number). To diagnose,
check what field that value is held in in your DB, check your SQL
statement and see whether this field is used as part of the join - if
so, what's the field-type it's trying to join to.

HTH
Martin

Hexman wrote:
Izzy,

Not Quite.

I'm doing this in SS and get this error.

Msg 245, Level 16, State 1, Line 2
Conversion failed when converting the nvarchar value '34101-9 -SS' to data type smallint.

This is an item number (length 22) and its trying to convert to smallint???? I've checked the schema and it appears to be OK.

Here's my code.

use IMaster
select Inven.ActDate, Inven.Item, Inven.Descr, Inven.ProdLn,
Trans.TrnDate, Trans.TrnEffDate, Trans.Dept
from Inven inner join Trans on (Inven.ActDate = Trans.TrnDate and
Inven.Item = Trans.Item and Inven.ProdLn = Trans.ProdLn)
where Trans.TrnEffDate in (select top 3 Trans.TrnEffDate from Trans as subq
where subq.ActDate = Trans.TrnDate and subq.Item = Trans.Item and
subq.ProdLn = Trans.ProdLn)

Any Ideas?

Thanks for your Help,

Hexman


On 26 Sep 2006 07:03:07 -0700, "Izzy" <is************@gmail.comwrote:

Nice work Aaron!

Does this solve the problem Hexman?

Izzy
aa*********@gmail.com wrote:
yeah but you could easily do it as a correlated subquery

Orders and OrderDetails, ok?

Orders
OrderID CustomerID
1 1
2 2
3 3
4 1
5 2
6 3
7 456
8 443
9 3243
10 32443
11 234324

OrderDetails
1 1
2 1
2 2
2 3
3 1
3 2
3 3
3 4
3 5
3 6
3 7
4 1
4 2
4 3
4 4

THIS IS THE SIMPLE ONE
SELECT Orders.*, OrderDetails.LineItem
FROM Orders INNER JOIN OrderDetails ON Orders.OrderID =
OrderDetails.OrderID
WHERE OrderDetails.LineItem IN (Select Top 3 LineItem FROM OrderDetails
SUBQ WHERE SUBQ.OrderID = OrderDetails.OrderID)
ORDER BY 1, 3,2

THIS IS A RIGHT JOIN THAT WILL SHOW ALL ORDERS; EVEN WITHOUT LINEITEMS
SELECT Orders.OrderID, Orders.CustomerID, OrderDetails.LineItem
FROM Orders LEFT OUTER JOIN
OrderDetails ON Orders.OrderID =
OrderDetails.OrderID
WHERE (OrderDetails.LineItem IN
(SELECT TOP 3 LineItem
FROM OrderDetails AS SUBQ
WHERE (OrderID =
OrderDetails.OrderID))) OR OrderDetails.LineItem IS NULL
ORDER BY Orders.OrderID, OrderDetails.LineItem, Orders.CustomerID

RESULTS
OrderID CustomerID LineItem
1 1 1
2 2 1
2 2 2
2 2 3
3 3 1
3 3 2
3 3 3
4 1 1
4 1 2
4 1 3
5 2 NULL
6 3 NULL
7 456 NULL
8 443 NULL
9 3243 NULL
10 32443 NULL
11 234324 NULL
HTH Dog; let me know if i can help more

-Aaron

Pritcham wrote:
Hi

I don't think you're going to be able to do this as the "Top x" clause
is going to limit your resultset to x number of records, not x number
of records for each 'grouping' (i.e. the link between your two tables)
so no matter how you try to link the results of this subquery to your
master table, you're only ever (at best) going to get x records from
the subquery.

Cheers
Martin

Hexman wrote:
Izzy,
>
Thanks for the response. I still can't get it to work, either with Access or SS EE. It generates no error during execution, but doesn't return any
rows. If I take out the "(SELECT TOP 3 t2.* FROM t2)" and change all "t3" references to "t2", it retrieves the rows (except too many of them).
>
This has me stumped. Any further ideas?
>
All I want to do is limit the number of rows returned from t2 to be joined with t1.
>
Thanks,
>
Hexman
>
>
On 23 Sep 2006 16:17:22 -0700, "Izzy" <is************@gmail.comwrote:
>
Try this: (Or something of the like)

SELECT t1.*, t3.*
FROM t1
INNER JOIN
(SELECT TOP 3 t2.*
FROM t2) t3 ON t1.Item = t3.Item
WHERE (t1.TrnDate = #09/23/06#)

You may even want too use a LEFT OUTER JOIN for this, depends on your
data.

Izzy

Hexman wrote:
Hello All,
>
How do I limit the number of detail records selected in a Master-Detail set using SQL?
>
I want to select all master records for a date, but only the first 3 records for the details (based on the primary key of the detail record). I've
been trying with "TOP 3", but can't get anywhere. Using Access 2000.
>
Something like:
>
SELECT t1.*, TOP 3 t2.*
FROM t1, t2
WHERE (t1.item = t2.item) AND (t1.TrnDate = #09/23/06#)
>
Any help appreciated,
>
Hexman
Sep 28 '06 #16

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

Similar topics

2
by: web developer | last post by:
hi I need to write a stored procedure that takes input parameters,and according to these parameters the retrieved fields in a select statement are chosen. what i need to know is how to make the...
6
by: Doohan W. | last post by:
Hi, I'm now working with DB2, and I can't find out how to execute the contents of a string Statement, without using a Java/... procedure, only using SQL statements. I know that some SQBDs such...
7
by: mark | last post by:
Access 2000: I creating a report that has a record source built by the user who selects the WHERE values. An example is: SELECT * FROM CHARGELOG WHERE STDATE Between #10/27/2003# And...
2
by: Jo Davis | last post by:
access fe and access be. later the be might be sql server I don't want people to pass this application around. And I want control over usage. I want it to 'expire' after a while. I have fairly...
5
by: m_t_hill | last post by:
Running MS Access 2000 MS Windows XP Pro This has caused me a lot of hair loss in the last few days so would appreciate any help. I am running code to append/update a local access database...
4
by: N J | last post by:
Hi, I ahve developed a program using access and am distributing it using MDE's, I ahve had many requests for a demo. I was thinking of limiting the number of records to say 100? If anyone has...
0
by: Jay C. | last post by:
Jay 3 Jan. 11:38 Optionen anzeigen Newsgroups: microsoft.public.dotnet.framework.webservices.enhancements Von: "Jay" <p.brunm...@nusurf.at> - Nachrichten dieses Autors suchen Datum: 3 Jan...
6
by: dmonroe | last post by:
hi group -- Im having a nested inner join problem with an Access SQl statement/Query design. Im running the query from ASP and not usng the access interface at all. Here's the tables: ...
21
by: rfdjr1 | last post by:
I'm using Access 2000. I have a raher simple database of my CD collection, with just three fields, Artist, Album Title and Type of Music. While going to update it today with a couple new CD's, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.