Re: Please help, Report Prob

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi again,
here's another quick question.
How can i separated different items according to delivery address into
another con note but view in single page? do i have to use group_id? please
help.

many thanks
--
ShallowRacer


"Cindy Winegarden" wrote:

Hi ShallowRacer,

First, a few tricks. your code :

if .not. used('product')
use product in 0
endif
select product
set order to prod_code

can be reduced to

Use Product in Select("Product") Order Prod_Code

There is no need to Select the table if you're going to open another one
right away in another work area.

Second, forget about relating tables. Select _ALL_ the data from the
appropriate tables exactly the way you want to see it in your report. Some
fields such as the address (since you're grouping products delivered to the
same address) will be repeated for several rows. In your report controls use
MyField only and not curI_ITEM.MyField. After the SQL runs the result is
automatically the current work area and the record pointer is positioned at
the top of the cursor (no need to Go Top).

In your SQL below you include the Customer table and it is joined to the
Invoice and Sales tables, yet you do not include any fields from the
Customer talbe in your Select clause. I assume the Customer table has the
address you want to send the items to, you will group on some Customer
field, and the address will show in the Group Header of the report.

-----------------------------------------------------------
select sales.inst_name, ;
sales.inst_st1, ;
sales.inst_st2, ;
sales.inst_sub, ;
sales.inst_state, ;
sales.inst_pc, ;
sales.cust_code, ;
sales.inst_spec, ;
i_item.inv_no, ;
i_item.unit_meas, ;
i_item.item_desc, ;
i_item.qty, ;
invoice.con_no, ;
invoice.con_date ;
from i_item, sales, customer, invoice ;
where invoice.inv_no = i_item.inv_no ;
and sales.sales_no = invoice.sales_no ;
and sales.cust_code = invoice.cust_code ;
and customer.cust_code = invoice.cust_code ;
and customer.cust_code = sales.cust_code ;
and empty(invoice.con_no) ;
and customer.transport = "GMK" ;
order by sales.inst_name, ;
sales.inst_st1, ;
sales.inst_st2, ;
sales.inst_sub, ;
sales.inst_state, ;
sales.inst_pc, ;
sales.cust_code ;
group by sales.inst_st1, ;
sales.inst_st2, ;
sales.inst_sub, ;
sales.inst_state, ;
sales.inst_pc, ;
sales.inst_name, ;
sales.cust_code ;
into cursor curI_ITEM
--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@xxxxxxx www.cindywinegarden.com


"ShallowRacer" <ShallowRacer@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9F21486C-0B50-401A-ACC2-55B8CF6F5710@xxxxxxxxxxxxxxxx
Hi there,
After trying out the report sometimes, i've successfully show the
delivery address and cust_code. Items are listed in the required area too,
however, the listed items are not listed accordingly to the delivery
address and cust_code. Kindly find below are my codes. FYI, i've created
a data grouping in the report and have the group expression of
invoice.inv_no = i_item.inv_no. Does it affect the items listed
incorrectly?
Should i create the data grouping?

-----------------------------------------------------------
select sales.inst_name, ; .....

As i mentioned before, i've to create the con_no and con_date once
the items are listed correctly accordingly to the cust_code and delivery
address, the con_no & con_date currently is empty in the table. I
would really appreciate if you can help me with this issue.

1. I don't see any relation between the invoice table and the customer
table.
2. you don't care about the customer info ?
select * from i_item where inv_no in (select inv_no from invoice where
empty(con_no) == .t. and deliv_add1 in (select deliv_add1 from invoice)
sort
by deliv_add1)
as a start ... then try isnull() as well.

3. then what about incrementing con_no for printing? ? i understand
consolidation, but suggest you assign the number PRIOR to printing it,
using
what ever business rule you use for consolidation. Usually a
consolidated
weigh bill has a unique number - its ok if you are using incremental #'s
for
that, but i suggest 2 more tables - one for the consolidation #'s - 1:1
and
another for storing invoice to consolidating #'s (many to many, store
keys
where cons_key can represent numerous invoice keys.) If you need further
help, contact me via email. [look for email addys in the sites below]

Am currently doing a consignment note.
Use 4 major tables:
- customer(cust_code, transport)
- sales
- invoice(inv_no, deliv_add1, deliv_add2, deliv_sub, deliv_state,
deliv_pc,
con_no)
- i_item(inv_no, unit, item_desc, qty)

Aim is to grab the items which has empty con_no and are going to the
same
deliv_add + display multiple results in single page and also
incrementing
the
con_no in the new page header.



.



Relevant Pages

  • Re: Please help, Report Prob
    ... After trying out the report sometimes, ... delivery address and cust_code. ... set order to prod_code ... what ever business rule you use for consolidation. ...
    (microsoft.public.fox.vfp.reports.printing)
  • Re: Please help, Report Prob
    ... appropriate tables exactly the way you want to see it in your report. ... Invoice and Sales tables, yet you do not include any fields from the ... Customer talbe in your Select clause. ... what ever business rule you use for consolidation. ...
    (microsoft.public.fox.vfp.reports.printing)
  • Re: How can I calculate the number of days between two delivery dates?
    ... There will be several deliveries to each customer. ... them by ascending delivery date (which is the same as sorting by the ... This query currently gives me the data that I can then ... Print the next predicted delivery date on the report. ...
    (microsoft.public.access.reports)
  • Re: new record and form
    ... So i have 4 tab pages Registration, progress, delivery and baby, and after delivery care. ... I do believe however that it is important that your database models the entity type which is the relationship between a mother and her infants *in the context of the database*. ... As regards a report this is, as Phil has pointed out, more a question of creating a query which joins the relevant tables and returns rows for each shift. ...
    (microsoft.public.access.gettingstarted)
  • Re: hot sell nike,jordan series,adidas,max,t-shirt,jean,handbag,children shoes,woman under wear
    ... We offer very special prices to our ... customer.. ... delivery by TNT, DHL OR EMS, we can delivery within 24 hours upon ... It is very safe door to door service, ...
    (comp.os.linux.misc)