One of our users has requested that we create a job that will automatically close the RMA (return material authorization) lines and RMA header if certain criteria is met.
I have attached a document outlining the criteria. I have been working on a select statement first to make sure the records returned are meeting the criteria and I don't know how to make one of the criteria work, which is for the credit check.
I also attached my select query if needed. How to I add the code for the credit check?
Thanks for the help.
Betty
Need help with SQL Update Statement
-
- Lounger
- Posts: 36
- Joined: 27 Sep 2011, 18:35
Need help with SQL Update Statement
You do not have the required permissions to view the files attached to this post.
-
- 4StarLounger
- Posts: 482
- Joined: 24 Jan 2010, 15:02
- Location: Colorado, USA
Re: Need help with SQL Update Statement
It depends on what kind of field type RMADetail.iscustomercredit is. If it is a Boolean field, you can use True, if it is a numeric field, you could say Not Null. But we need to know more about where the query is being run - is it in SQL Server or is it in Access - to be really helpful. Also the version of what you are using, ie SQL Server 2012, or Access 2010.
Wendell
You can't see the view if you don't climb the mountain!
You can't see the view if you don't climb the mountain!
-
- Lounger
- Posts: 36
- Joined: 27 Sep 2011, 18:35
Re: Need help with SQL Update Statement
I am using SQL 2014. The RMADetail.IsCustomerCredit field is a bit field.
Thanks.
Betty
Thanks.
Betty
-
- Administrator
- Posts: 78591
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Need help with SQL Update Statement
Does it do what you want if you add
AND (RMADetail.IsCustomerCredit = 0 OR RMADetail.AWBToReceive = 'EV' OR RMADetail.AWBToReceive IS NULL)
AND (RMADetail.IsCustomerCredit = 0 OR RMADetail.AWBToReceive = 'EV' OR RMADetail.AWBToReceive IS NULL)
Best wishes,
Hans
Hans
-
- Lounger
- Posts: 36
- Joined: 27 Sep 2011, 18:35
Re: Need help with SQL Update Statement
I will give this a try, HansV. I'll let you know.
Thanks.
Betty
Thanks.
Betty
-
- Lounger
- Posts: 36
- Joined: 27 Sep 2011, 18:35
Re: Need help with SQL Update Statement
Hans,
I had to make one change but it appears to be working. Thank you for the help.
Betty
I had to make one change but it appears to be working. Thank you for the help.
Betty