473,802 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Query not getting all data

1 New Member
I have a query built to extract data. No errors when it runs however it gets some of the data but not all of the data. Below is an example of the query and the results. Here is an example... Each job has a PO and multiple lines it might get line 2,3,5,7 but miss 1,4,6,8


Here is the example. This is in sql 2005

--select * from p21_order_view
--
use p21
select p21_order_view. order_no, ship2_name, order_date, po_no, line_no, disposition, item_id, qty_ordered, unit_price, extended_price, sales_cost,
pick_ticket_no, print_date,trac king_no, ship_quantity, invoice_no, invoice_date
from p21_order_view
left outer join
(select p21_view_oe_pic k_ticket.pick_t icket_no, p21_view_oe_pic k_ticket.order_ no, oe_line_no, p21_view_oe_pic k_ticket.print_ date,
tracking_no, p21_view_oe_pic k_ticket.invoic e_no, invoice_date, ship_quantity
from p21_view_oe_pic k_ticket
inner join p21_view_oe_pic k_ticket_detail on p21_view_oe_pic k_ticket.pick_t icket_no = p21_view_oe_pic k_ticket_detail .pick_ticket_no
left outer join p21_view_invoic e_hdr on p21_view_oe_pic k_ticket.invoic e_no = p21_view_invoic e_hdr.invoice_n o
where tracking_no not like '%CANCELLED%') as pick_ticket_inf o
on p21_order_view. order_no = pick_ticket_inf o.order_no and p21_order_view. line_no = pick_ticket_inf o.oe_line_no
where hdr_delete_flag = 'N' and hdr_cancel_flag = 'N' and line_cancel_fla g = 'N' and disposition <> 'C'
and order_date >= '01/01/08' order by order_date desc, p21_order_view. order_no, line_no
--
--sp_help oe_pick_ticket_ detail
--
--select p21_view_oe_pic k_ticket.pick_t icket_no, p21_view_oe_pic k_ticket.order_ no, oe_line_no, p21_view_oe_pic k_ticket.print_ date,
--tracking_no, p21_view_oe_pic k_ticket.invoic e_no, invoice_date
--from p21_view_oe_pic k_ticket
--inner join p21_view_oe_pic k_ticket_detail on p21_view_oe_pic k_ticket.pick_t icket_no = p21_view_oe_pic k_ticket_detail .pick_ticket_no
--left outer join p21_view_invoic e_hdr on p21_view_oe_pic k_ticket.invoic e_no = p21_view_invoic e_hdr.invoice_n o
--
--select * from p21_view_oe_pic k_ticket_detail
--select * from p21_view_oe_pic k_ticket
--sp_help oe_pick_ticket






This is an example of what is happening


It's hard to see but this example is missing line 2,3,6. I hightlighted the line numbers in red. The lines are in the system though


1001199 WRIGLEY YORKVILLE 2008-04-08 11:35:11.000 4500666698 1 B 2108423 2.000000000 0.000000000 0.0000 622.600000000 NULL NULL NULL NULL
1001199 WRIGLEY YORKVILLE 2008-04-08 11:35:11.000 4500666698 4 B 2032416 3.000000000 386.200000000 1158.6000 309.000000000 NULL NULL NULL NULL
1001199 WRIGLEY YORKVILLE 2008-04-08 11:35:11.000 4500666698 5 B 2031692 8.000000000 48.130000000 385.0400 36.800664300 NULL NULL NULL NULL
1001199 WRIGLEY YORKVILLE 2008-04-08 11:35:11.000 4500666698 7 B 2029842 1.000000000 0.000000000 0.0000 175.000000000 NULL NULL NULL NULL
1001199 WRIGLEY YORKVILLE 2008-04-08 11:35:11.000 4500666698 8 B 2008349 4.000000000 0.000000000 0.0000 95.000000000 NULL NULL NULL NULL
Apr 9 '08 #1
1 1111
rjvrnjn
26 New Member
The post is very poorly formatted to make it readable. Also, do you really need to post the commented lines? The highlighted text has not come through thus making the post incomplete. Please reformat it and make easy for others to have a look and make a suggestion.
Thanks.
Apr 9 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

29
2477
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules" for when and how to use single quotes and double quotes in ASP? thanks! ---------------------- SQL = SQL & "WHERE '" & REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE("GenKTitles.
9
11777
by: shank | last post by:
Per a previous suggestion, I'm trying to use a parametized query in Access 2002. The query functions properly in Access. Now I'm trying to call it from ASP. I'm using code I found at http://www.xefteri.com/articles/apr302002/default.aspx and trying to adjust for my needs. I'm getting this error. The query is there and functioning. It appears that I'm not connecting. Can I get some more insight? thanks! ------------------------------...
7
682768
by: vnl | last post by:
I'm trying to run a SQL query but can't find any records when trying to select a certain date. Here's the sql: SELECT field 1, field2, date_and_time, FROM table1 WHERE date_and_time = '01-SEP-02' I'm getting no results. The date_and_time field is formatted like this: 2002-SEP-02 00:01:04
7
4034
by: Phin | last post by:
I need your HELP! I've seen all the posts on using Crystal Reports within vs.net (vb.net) and changing a SQL query at runtime. When I tried to pass in a dataset into the crystal report at runtime, the report still showed the results from the default query (from within the Crystal Report). Then I tried the XSD solution where you define a dataset (that mataches the database and the Crystal Report) and have the Crystal Report use this....
4
2660
by: Orion | last post by:
Hi, This is kind of last minute, I have a day and a half left to figure this out. I'm working on a project using ms-sqlserver. We are creating a ticket sales system, as part of the system, I need to be able to do a search for specific tickets withing price ranges, different locations within the theaters, etc. etc. My problem is in the search one of the criteria is to search for a group of seats together. For example let's say...
6
4852
by: jjturon | last post by:
Can anyone help me?? I am trying to pass a Select Query variable to a table using Dlookup and return the value to same select query but to another field. Ex. SalesManID SalesManName AT Alan Time
5
9436
by: jonm4102 | last post by:
I'm trying to calculate the median of some numerical data. The data can only be found in a query (henceforth query 1) field I previously made, and I would prefer to calculate the median in a new query it without making a table out of query 1. I can't find a median function in the "Total" field, so is there so way to make an expression to calculate the median of the orignial data from query 1 in my new query? Also, what does name by...
0
2459
by: Chuck36963 | last post by:
Hi all, I've been working on a listing problem and I can't figure out how to work it out. I have looked far and wide on the web to find answers, but I'd like other peoples input on my project in the whole. I really need MySQL wizz to give me a hand (and maybe refer me to books to get me to the wizz level myself). First off, english is a second language to me and sometimes my sentences might be a little awkward. Please forgive me. Mon...
10
6238
by: aaronrm | last post by:
I have a real simple cross-tab query that I am trying to sum on as the action but I am getting the "data type mismatch criteria expression" error. About three queries up the food chain from this cross-tab query I am using a simple query with no grouping where I am filtering some data out in the criteria line. I have been out of access for a couple years but I remember in the past I had a solution for this but I can't remember. Any help...
3
1645
by: =?Utf-8?B?bXNjZXJ0aWZpZWQ=?= | last post by:
Has anyone successfully used an Access query from .NET? I am trying to do this and am getting a weird error. .NET calls queries 'stored procedures'. The error I am getting says "Schema could not be retrieved for this stored procedure' ... "The underlying enumerator did not support enumerating objects of type 'ProcedureParamater'". .Net does recognize the stored procedure i.e. it does appear in the drop-sdown list.
0
9562
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10304
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10063
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7598
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.