Skip to Content
Former Member

# Production Order

Hi All,

I Want To Make a Query in Which I need

1)Date And Quantity of Item Having ItemCode WH-100 From inventory Transfer

2) Quantity of Component item Whose item Code is 'WH-100' from production order But Here Date Should be From Receipt From Production

Please Help Me to Solve this Problem...

And Also I want to write this query in ms SQL server 2008

Best Regards,

Gayatri Shukla

##### Add a comment
10|10000 characters needed characters exceeded

### 4 Answers

• Best Answer
Posted on Nov 12, 2012 at 02:09 PM

Hi Gayatri Shukla...

Try This

Select DocDate,Quantity from wtr1 where itemcode like '%WH-100%'

Regards

Kennedy

##### Add a comment
10|10000 characters needed characters exceeded
• Former Member Kennedy T

Hi Kennedy,

Little Bit Changes in the Query Posted By You And I got the Required Result.

Thank you very much for your reply... 😊 😊

Regards,

Gayatri Shukla.

• Former Member
Posted on Nov 12, 2012 at 05:33 PM

Hi Gayatri,

What is the relationship between your two requirements? There is no logic bind for these conditions.

Thanks,

Gordon

##### Add a comment
10|10000 characters needed characters exceeded
• Former Member

Hi Sir(Gordon),

That is only the problem That What is the Relationship Between wtr1 and wor1.

please help me solve this puzzle.....

Best Regards,

Gayatri shukla.

• Former Member
Posted on Nov 12, 2012 at 06:11 PM

HI Gayatri,

The best way is to create some relation between all the tables and link them using any join and where clause.

You can also write different queries for all the tables. But this is not proper way and also it may result in wrong records.

So find relation (common fields) between the tables and describe that to create a proper query using joins.

Regards,

Gagandeep Singh

##### Add a comment
10|10000 characters needed characters exceeded
• Posted on Nov 14, 2012 at 06:51 AM

hi

find the query below

Select A.DocDate 'Receipt Date',

(SELECT Y.ItemCode FROM OITM Y WHERE Y.ItemCode = B.ItemCode AND Y.ItemCode like 'WH-100%%')'ItemCode',

(SELECT Y.ItemName FROM OITM Y WHERE Y.ItemCode = B.ItemCode AND Y.ItemCode like 'WH-100%%')'ItemName',

(SELECT X.Quantity FROM WTR1 X WHERE X.ItemCode = B.ItemCode AND X.ItemCode like 'WH-100%%')'Quantity '

FROM OIGN A INNER JOIN IGN1 B ON A.DocEntry = B.DocEntry

WHERE A.DocDate >='[%0]' AND A.DocDate <='[%1]'

Regards

Jenny

##### Add a comment
10|10000 characters needed characters exceeded

### Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.