报告是否可以显示新订单号和旧订单详细信息? [英] Can a report display a new order number and older order details?

查看:92
本文介绍了报告是否可以显示新订单号和旧订单详细信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

再次问好Bytes ...我想你了!


首先,背景:

在一个hotstick实验室,我们每两年发一次订单。我们发运新订单,客户使用新框返回上一年的订单。例如,我们在2007年11月发出了订单。 2009年11月,这些棒子到期了,我们发运了一个新订单(因为顾客不能没有棍棒),当他们收到新的2009年订单时,他们会退回旧的2007年订单。


每个订单发货时,箱号和发货日期都会放入数据库中。当该框返回时,希望在大约30天内,将box_return_date放入系统。这允许我使用基于参数查询的报告?自新发货以来超过xxx天。如果我输入60,它会告诉我是否在新订单发货后60天内没有退回任何包装盒(包含旧订单)(使用box_return_date = Null和now()的标准 - 发货日期> 60)。


问题:由于箱号和日期附在新订单上,订单详细信息显示新订单。但是因为我正在寻找从前一个订单返回的支柱,我实际上想要显示旧订单的详细信息。所以我想要新订单中的订单号和前一订单的订单详细信息(所有订单都由一个客户编号连接)。如果报告显示新旧订单号和详细信息,甚至可能更清楚。请记住,他们会在2005,2003等订购,我会*不想*显示。


如果你能提供任何指导,我当然会很感激。我现在已经认真思考了5个小时,而我有限的VBA技能使我无法提出解决方案。任何人都可以帮忙吗?

Hello again Bytes...I missed you!

First, background:
In a hotstick lab, we ship orders every two years. We ship a new order and the customer uses the new box to return the previous year''s order. For example, in November 2007 we shipped an order. November 2009 those sticks expire, and we ship a new order (because customers can''t be without sticks) and when they receive the new 2009 order they ship back the old 2007 order.

A box number and ship date are put in the DB when the each order is shipped. When that box comes back, hopefully in about 30 days, the box_return_date is put into the system. This allows me to use my report which is based on a parameter query ?More than xxx days since new shipment.? If I enter 60, it lets me know if any box (containing old order sticks) hasn?t been returned 60 days out from the new order shipment (using criteria of box_return_date=Null and now() - ship date > 60).

Problem: Because the box number and dates are attached to the new order, the order details show the new order. But since I?m looking for sticks to be returned from the previous order, I actually want to show the old order?s details. So I want the order number from the new order and the order details from the previous order (all connected by a single customer number). It might even be more clear if the report showed both old and new order number and details. Keep in mind they would have order in 2005,2003, etc that I would *not* want to show.

If you can offer any guidance, I would certainly appreciate it. I have thought intensely about this for 5 hours now and my limited VBA skills are preventing me from coming up with a solution. Can anyone help?

推荐答案

我想我明白你在问什么。以下是否对您有意义。


tblShipment
I think I understand what you are asking. Does the following make any sense to you.

tblShipment
展开 | 选择 | Wrap | 行号


It哈哈,几乎没有意义。

我可以阅读它并了解你想要做什么。


你提供的代码看起来与我的有点不同曾经......所以我猜它是一个SQL语句。 ??

我在哪里放?如果它是通过报告中的属性框(它链接到查询),我知道在哪里。但如果你把代码直接放在查询本身,我不知道它在哪里。


我到星期一,我不会尝试直到然后。非常感谢你的时间。
It barely makes sense, LOL.
I can read it and get an idea what you are trying to do.

The code you have provided looks a little different than what I''m used to...so I''m going to guess it''s a SQL statement. ??
Where do I put it? If it''s through the properties box in the report (where it links to the query), I know where. But if you put the code directly in the query itself, I don''t know where it goes.

I''m off til Monday and I won''t try it til then. Thanks so very much for your time.


我可以看到的一个问题(我没有经验的眼睛)在第7行,你的年份减去2.

考虑一下:2007年1月我们发货。 Sticks将于2009年1月到期,因此我们可能会在2008年12月发布新订单。现在我们有一年减1。


如果有帮助,ShipID是2007XXXX(XXXX =连续数字从0001)和2008XXXX等开始,所以这一年也是ShipID的一部分。这可能有益吗?
One problem I might be able to see (with my inexperienced eye) is in line 7 where you have year minus 2.
Consider this: January 2007 we ship an order. Sticks expire in January 2009 so we would likely ship the new order in December 2008. Now we have a year minus 1.

If it helps, the ShipID is 2007XXXX (XXXX=consecutive numbers beginning with 0001) and 2008XXXX, etc, so the year is also part of the ShipID. Could that be beneficial?


这篇关于报告是否可以显示新订单号和旧订单详细信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆