web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics RMS (Archived)

SQL Help: Making Items Inactive by Item Lookup Code Prefix

(0) ShareShare
ReportReport
Posted on by 908

Hi there!

The first three letters of our Item Lookup Code are the vendors/suppliers from where the product came.  We have a few suppliers who have, over the years, gone out of business. I would like to make those items inactive.

Could someone help me with an SQL Query for Headquarters that would enable me to make an item inactive if the item lookup code begins with three letters, and Current Inventory On Hand is 0?

Thanks in advance! :)

*This post is locked for comments

I have the same question (0)
  • Bennykendy Profile Picture
    840 on at
    RE: SQL Help: Making Items Inactive by Item Lookup Code Prefix

    Thanks. It just worked perfectly.

    Can any one write a report where I can determined how long an item has been in my store? I want to have a report that will notify the period of time an item has been on a store and for how many months. For example, an item, say a computer, was shipped into my store January 10. Now we are in July. That is 6months old. I would love a report that will give me such information concerning the duration of time the item has been in my store.

    Can anyone help, please?

    Thanks in advance!

  • IT Licensing Profile Picture
    65 on at
    RE: SQL Help: Making Items Inactive by Item Lookup Code Prefix

    this information was very helpful to me, thank you!

  • Gerald Rothaus Profile Picture
    2,934 on at
    RE: SQL Help: Making Items Inactive by Item Lookup Code Prefix

    Um, good job there.

  • Sad Profile Picture
    650 on at
    RE: SQL Help: Making Items Inactive by Item Lookup Code Prefix

    Hi,

    1- backup Database

    2- run Select quiry with the same creteria

    Select itemlookupcade,description from [item] WHERE left([description], 3) = 'ABC' AND [Quantity] = 0

    and check the items in result " to make sure "

    3-if all is ok ,run Update quiry

    UPDATE [item] SET [Inactive]=1 WHERE left([description], 3) = 'ABC' AND [Quantity] = 0;

    hope this will help

  • Taier P Profile Picture
    908 on at
    RE: SQL Help: Making Items Inactive by Item Lookup Code Prefix

    Thanks, Justin! :)  Much appreciated!

  • Community Member Profile Picture
    on at
    RE: SQL Help: Making Items Inactive by Item Lookup Code Prefix

    Thanks for the help with the spam guys and sorry about the delay in removing it. I have deleted it and Rajendra is no longer a member of the Community. Please keep sending spam our way. I will get to it quicker in the future.

  • Taier P Profile Picture
    908 on at
    RE: SQL Help: Making Items Inactive by Item Lookup Code Prefix

    Okay, let's make this clear:  This is a board for communicating information and solutions based on experience and knowledge, NOT a place to market or peddle your products, merchandise, or services.

    I've reported both people who have used this forum as a place for advertising.

    Members of this community are here to help each other by sharing information.  We are NOT interested in buying your plug ins or add ons. We are definitely not interested in a moving company located in India.  Stop wasting your time and ours by being annoying and trying to sell things to people who are not in the market for your goods...

  • Gerald Rothaus Profile Picture
    2,934 on at
    RE: SQL Help: Making Items Inactive by Item Lookup Code Prefix

    This guy is like the drunk at your grandparents anniversary party.

    You can't wait 'till he leaves, right?

    Am I right?

  • Gerald Rothaus Profile Picture
    2,934 on at
    RE: SQL Help: Making Items Inactive by Item Lookup Code Prefix

    Oh. Right then.

    :)

    You should do the other guy too.

  • Taier P Profile Picture
    908 on at
    RE: SQL Help: Making Items Inactive by Item Lookup Code Prefix

    Not you... I reported Rajendra25.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics RMS (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans