none
Repeating a query multiple times with a list of names RRS feed

  • Question

  • Hi

    I have a query to run on a SQL database which basically changes some values and deletes some items

    I need to run this same query for 100's of different "names"

    So taking below as an simple example to run it for one name

    declare @profilename varchar(60);
    set @profilename ='Name'
    
    
    delete from PaymentMethodwhere paymentid in (select id from payment where name=@profilename)
    Instead of running this and changing 'Name' to each of the 100's of names, how can I get it to loop and perhaps read from a list of names in a txt or csv file and repeat the above for each name on the list?


    Darren Rose

    Saturday, September 7, 2019 5:08 PM

Answers

  • @Soumen Barua

    Thank you for your input - I appreciate it.  Sorry you got hassled for trying to help me

    @All

    Thanks for all the responses, this is clearly not a forum for newbies in SQL like me to ask questions it would appear, as everyone here is at a much greater level of understanding and seem easily irritated by others.  But I do appreciate the replies, but this time it ended up much easier for me to just use something as silly as mailmerge to create a long script repeating above code but replacing 'name' with an entry from my list.  Once Erland told me how to cope with ' in names as well this ran and did the job I needed much quicker than me trying to learn something I am struggling with

    Thanks again


    Darren Rose

    EDIT : Marked as answer - even thought I know not an ideal answer, but it was how I solved it this time, due to lack of understanding as to other suggestions/replies


    • Marked as answer by wingers Sunday, September 8, 2019 6:39 PM
    • Edited by wingers Sunday, September 8, 2019 6:40 PM
    Sunday, September 8, 2019 11:18 AM

All replies

  • Hi

    I have a query to run on a SQL database which basically changes some values and deletes some items

    I need to run this same query for 100's of different "names"

    So taking below as an simple example to run it for one name

    declare @profilename varchar(60);
    set @profilename ='Name'
    
    
    delete from PaymentMethodwhere paymentid in (select id from payment where name=@profilename)
    Instead of running this and changing 'Name' to each of the 100's of names, how can I get it to loop and perhaps read from a list of names in a txt or csv file and repeat the above for each name on the list?


    Darren Rose

    Good day wingers,

    If you only want to delete rows which exists in another table then this can be done directly using "where paymentid in (Select x from Second_Table)". If you have SET of names which are not in a table then you create temp table and insert these values and solve in the same way.

    If you need more complex case like using both update and delete for example, or in any case which is not cover above, Please provide:

    1) Queries to CREATE your table(s) including indexes
    2) Queries  to INSERT sample data.
    3) The desired result given the sample, as text or image of excel for example.
    4) A short description of the business rules, and how you got 1-2 of the results
    5) Which version of SQL Server you are using (this will help to fit the query to your version).

    In the mean time you can check the following document about using MERGE query.


    signature   Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]    [Linkedin]


    Saturday, September 7, 2019 5:16 PM
    Moderator
  • Hi

    It is an existing client database, so query to create it is not really relevant to my question, neither is point 2

    In simpler terms I want to know how to loop a query multiple times, each times using a different value (varchar) for the 'name' variable

    How I provide the list of names doesn't bother me - either a txt file or a csv file, but basically just want to save having to manually change the 'name' variable and running the query 100+ times 

    Version of SQL is 2012 Express in this case


    Darren Rose

    Saturday, September 7, 2019 5:31 PM
  • I am not an expert on SQL hence asking, but if I was something in VB the equivalent would be:-

    Dim names() As String = {"abc", "def", "ghi"}

            For each name As string In names
                MsgBox(name)
            Next

    Darren Rose

    Saturday, September 7, 2019 5:37 PM
  • If it is not a frequent regular task, then, instead of a separate text file, you can enumerate the values inside this script. One of the approaches:

     

    delete from PaymentMethod

    where paymentid in (select id from payment where name in

    (

       'Name1',

       'Name2',

       'Name3',

       . . .

    ) )




    • Edited by Viorel_MVP Saturday, September 7, 2019 6:13 PM
    Saturday, September 7, 2019 6:02 PM
  • It is an existing client database, so query to create it is not really relevant to my question, neither is point 2

    The reason that Ronen asked you for this is that with CREATE TABLE + INSERT, we get something we can copy into a query window to develop a tested solution. It may be an existing client database, but we don't see that database, so that does not help us.

    In simpler terms I want to know how to loop a query multiple times, each times using a different value (varchar) for the 'name' variable

    The code you posted was this:

    declare @profilename varchar(60);
    set @profilename ='Name'

    delete from PaymentMethod where paymentid in (select id from payment where name=@profilename)

    Here "name" appears in two places:
    1) It is the value for the variable @profilename.
    2) It is the name of a column in the table payment.

    But there is no variable call @name in your example. It may irritate you that I pick on terminology, but inaccurate terminology introduces an uncertainty what you are looking for. (And this is surely the reason Ronen asked for clarification.)

    I will have to assume that you want to delete rows from PaymentMehtod paymentid matches a row in payment where the name is any of the 100 names you have in your file. In that case, the code is:

    DELETE paymentMethod
    FROM   paymentMethod pm
    WHERE  EXISTS (SELECT *
                   FROM   Payment p
                   WHERE  pm.PaymentId = P.PaymentID
                     AND  EXISTS (SELECT *
                                  FROM   @names n
                                  WHERE  n.name = P.name))

    @names is a table variable which you have filled with the names you want to delete rows for. If you are calling this from an application, you would pass the name in a table-valued parameter. I have an article on my web site that gives an introduction to use table-valued parameters in .NET:
    http://www.sommarskog.se/arrays-in-sql-2008.html


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    Saturday, September 7, 2019 6:22 PM
    Moderator
  • I am not an expert on SQL hence asking, but if I was something in VB the equivalent would be:-

    Dim names() As String = {"abc", "def", "ghi"}

            For each name As string In names
                MsgBox(name)
            Next

    Darren Rose

    Hi,

    >> I am not an expert on SQL hence asking query to create it is not really relevant to my question

    If you are not expert and you get this respond, then why you assume that it is not relevant?!?
    Why do you come here if you do not listen to others?

    Let's see why this is relevant:

    You want us to provide you a query.
    How can we test our solution before posting it is we do not have table with some data?
    How should we know what is the structure of the table - list of columns and type of columns? and what indexes you have??? The answer can be totally different if you have one index or another or if your table has one structure or another!

    Without this information we can only guess!

    >> It is an existing client database

    Speaking about NOT RELEVANT!

    What do we care who own the database?
    If you have permission to use the database and insert/delete/update data in a table then you should be able to provide queries to create similar table IF YOU KNOW HOW TO CREATE TABLE AND INSERT DATA. if you do not know something that we are here to help, but not knowing does not make it not possible :-) 

    >> In simpler terms I want to know how to loop a query multiple times

    SQL Server like other tabular databases is not build to work best with loops, but it is optimized to work with SET of data. According to your description (assuming it is full and I got it well) your solution does not require any loop. Looping is approach which fit programming usually and not databases.

    NOT EVERYTHING THAT WORK SHOULD BE DONE.

    Once you will do your part and provide the information, it will be simpler to help you find a good solution and not just a working solution in the approach your asked for.


    signature   Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]    [Linkedin]

    Saturday, September 7, 2019 6:35 PM
    Moderator
  • Okay fair point and I apologize, just didn't initially see how it was relevant, and since it is an existing client database that is accessed from a bit of software my client uses I don't have or see that information.

    It is simply that we need to perform some maintenance on that database and the company who make the program gave us a script to run to delete several entries using "Delete From **** where name=@profilename"

    But as we have 100's of profilename's to pass I wanted to loop it somehow

    @Erland

    Sorry for my confusing example

    name is a column in the database, I shouldn't have used it as my example as well so instead

    declare @profilename varchar(60);
    set @profilename ='Fred Bloggs'
    
    
    delete from PaymentMethodwhere paymentid in (select id from payment where name=@profilename)


    Darren Rose

    Saturday, September 7, 2019 6:46 PM
  • @Erland

    Thanks for example

    In my original post I just had one example of a table it would delete from - the actual query/script they are asking me to run has about 15 lines and it deletes @profilename from various different tables in one database

    I just put one line as an example, but should have explained it further

    @Ronen

    Sorry for lack of information, but I didn't have what you asked for - I just need to be able to run the script provided but for 100+ different "profilenames" - hence assuming looping through and repeating same script multiple times for each "profilename" would be best option.  My background in VB probably made me think wrongly here.

    It is a one time task so how long it takes to run this once is not really an issue

    Thanks


    Darren Rose

    Saturday, September 7, 2019 6:51 PM
  • below is the full script (some field names changed for security reasons) - so this needs to be run for 117 different names e.g. the name I supply in the 'Profile Name' field if I run it manually for each one

    declare @profilename varchar(60);
    set @profilename ='Profile Name'
    
    
    delete from PaymentType where paymentid in (select id from runtype where name=@profilename )
    delete from runoption where paymentid in  (select id from payrun where runtype in (select id from runtype where name=@profilename))
    delete from runoption where runtypeid in (select id from runtype where name=@profilename)
    delete from Rule where Step in (select id from Step where paymentrunid in (select id from payrun where runtype in (select id from runtype where name=@profilename)))
    delete from Step where paymentrunid in (select id from payrun where runtype in (select id from runtype where name=@profilename))
    delete from History where runtype in (select id from runtype where name=@profilename)
    delete from payrun where runtype in(select id from runtype where name=@profilename)
    delete from runtype where name=@profilename


    Darren Rose

    Saturday, September 7, 2019 6:55 PM
  • Okay fair point and I apologize...

    Great, so can you provide the information?

    1. Do you know how to create simple table using queries which has the columns as you have in your real table?
    If yes, then please provide the code
    If no, then please inform us

    2. Do you know how to INSERT data to the table using queries?
    Again, if you do then please provider the sample data

    Next, provide a sample of list of Names which you want delete from the table

    Using this information we will be able to provide fast (for us) simple solution (for you) 

    * With that being said you already got a sample of solution and short explanation.


    signature   Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]    [Linkedin]

    Saturday, September 7, 2019 6:59 PM
    Moderator
  • In my original post I just had one example of a table it would delete from - the actual query/script they are asking me to run has about 15 lines and it deletes @profilename from various different tables in one database

    So you would need to run variations of the query that I posted each one of these tables. There is no macro facility like "run this query pattern for this list of tables". You could roll your own with dynamic SQL, but with that handful of tables it is not worth the complexity.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    Saturday, September 7, 2019 7:26 PM
    Moderator
  • @Ronen

    1) Yes I know how to create a table and columns, but no I can't do it to replicate this database as it has many tables and many columns and is quite complex

    2) Yes I know how to insert data into a database, but don't need to with this one as it is used by a piece of software so never need to do anything "manually" so to speak

    If I run the query I provided and enter a correct name then it does what it is meant to do and removes all the entries from the various locations for that name, so I know it works for one "name" at a time, so just a matter of learning how to pass a list of names to it, either entering them in query as comma separated, or getting it to read them from a txt / csv file

    Just normal names e.g. "Fred Bloggs", "Adam Smith", "Darren Rose" etc


    Darren Rose

    Saturday, September 7, 2019 7:26 PM
  • 1) Yes I know how to create a table and columns, but no I can't do it to replicate this database as it has many tables and many columns and is quite complex

    2) Yes I know how to insert data into a database, but don't need to with this one as it is used by a piece of software so never need to do anything "manually" so to speak

    I don't think we need CREATE TABLE + INSERT in this case - at least not as long as the query pattern I posted works for you.

    But you should know that both I and Ronen both have seen more than one too many of vaguely formed questions that have left us in an uncertainty of what the poster was looking for. More than once have still tried to be helpful and provided a query based on guesswork. More than once our guesses have been wrong, and the poster have just been frustrated.

    So by time we have acquired an allergy against such questions, and when we don't understand, we often ask people for clarification, and we have found that clarification from code and tables helps more than words.
    And, yes, sometimes, we might have gotten the point if we had spent some more time on reading the post, but keep in mind that we answer questions here in our free time.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    Saturday, September 7, 2019 8:24 PM
    Moderator
  • @Erland

    I completely understand, and sorry I didn't explain myself fully initially

    Turns out this is going to be quicker for me to do by just running script and changing name each time than it is to learn something I know nothing about.  I had wrongly assumed there would be an easy workaround by looping or similar, but not to worry

    I have come across an issue however

    Some of the names seem to have a ' in them

    e.g.

    Fred's Dog Food

    So obviously the query has an error if I do 

    set @profilename ='Fred's Dog Food'

    so how do I get around names which have a ' in them?


    Darren Rose

    Saturday, September 7, 2019 8:51 PM
  • So if you had followed the pattern I showed you, but rather than having a table variable, you had defined a permanent table to hold the values, you could have entered the values for the names through the UI in SSMS, and then you would not have run into the issue with the single quote.

    And you would have learnt something for the next time you need to do the same exercise.
    All languages provide a mean to deal with nested string delimiters. In some like C++ or C#, you use an escape character, typically the backslash. In other languages, and T-SQL is in this group, you double the delimiter to include it. That is,
    set @profilename ='Fred''s Dog Food'


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    Saturday, September 7, 2019 9:10 PM
    Moderator
  • Noted and thank you

    Darren Rose

    Saturday, September 7, 2019 9:40 PM
  • Hi,

    You can try something like following:

    declare @names table (id int identity, name varchar(200))
    declare @i int = 1, @counter int = 0, @profilename varchar(200) = '';

    insert @names vallues ('Fred Bolg', 'Fred''s dog food')
    select @counter = max(id) from @names;
    while (@i <= @counter) 
    begin
    select @profilename = name from @names where id = @i 

    /* run your script here */
    delete from PaymentType where paymentid in (select id from runtype where name=@profilename )
    delete from runoption where paymentid in  (select id from payrun where runtype in (select id from runtype where name=@profilename))
    delete from runoption where runtypeid in (select id from runtype where name=@profilename)
    delete from Rule where Step in (select id from Step where paymentrunid in (select id from payrun where runtype in (select id from runtype where name=@profilename)))
    delete from Step where paymentrunid in (select id from payrun where runtype in (select id from runtype where name=@profilename))
    delete from History where runtype in (select id from runtype where name=@profilename)
    delete from payrun where runtype in(select id from runtype where name=@profilename)
    delete from runtype where name=@profilename
    @i = @i + 1;
    end


    Sunday, September 8, 2019 3:20 AM
  • Hi,

    You can try something like following:

    declare @names table (id int identity, name varchar(200))
    declare @i int = 1, @counter int = 0, @profilename varchar(200) = '';

    insert @names vallues ('Fred Bolg', 'Fred''s dog food')
    select @counter = max(id) from @names;
    while (@i <= @counter) 
    begin
    select @profilename = name from @names where id = @i 

    /* run your script here */
    delete from PaymentType where paymentid in (select id from runtype where name=@profilename )
    delete from runoption where paymentid in  (select id from payrun where runtype in (select id from runtype where name=@profilename))
    delete from runoption where runtypeid in (select id from runtype where name=@profilename)
    delete from Rule where Step in (select id from Step where paymentrunid in (select id from payrun where runtype in (select id from runtype where name=@profilename)))
    delete from Step where paymentrunid in (select id from payrun where runtype in (select id from runtype where name=@profilename))
    delete from History where runtype in (select id from runtype where name=@profilename)
    delete from payrun where runtype in(select id from runtype where name=@profilename)
    delete from runtype where name=@profilename
    @i = @i + 1;
    end

    Wow😲...

    Firs, thanks Soumen for participating in the forum and helping people.
    This is highly appreciated 👍

    With that being said, your code is simply awful. It includes multiple basic issues/mistakes and no one should use this solution. Let me go over some points starting from negligible typo and moving to a serious approach issues

    1. You have a small typo using "vallues" instead of "values"

    This is good example why having the DDL+DML allow us to execute our answer before posting it, which will confirm that we do not have typo

    2. You use "max(id)" in order to loop from 1 to that number. This is a very problematic and performance issue! Since you are using INT, your max(id) might be 2,147,483,647 but this has nothing to do with the number of rows. If you INSERT and DELETE rows your table might have 10 rows but max(id) 2,147,483,647

    Do you want to loop 2,147,483,647 times instead of 10 ?!?

    3. You basic approach of using loop for this simple task is really bad!

    Think about what your code do!

    You loop multiple times and each time you read the the index or the entire table PaymentType (depending on the table structure and the indexes which the OP failed to provide)

    Moreover, in each iteration of the loop you also need to read the index or entire table runtype (again depending on the table structure)

    This make no sense.

    Please read the responses which me and Erland wrote during the discussion.

    Again, I really mean it when I said that I highly appreciate your contribution and the fact that you help people in the forum. We all can make mistakes and I do not want to discourage in any way from continue helping people, by pointing on an issue in specific answer. I think that the world could be much better if there were more people that help others and not just these who seek for help but do not contribute their share 😃

    Please check the previous discussion and try to avoid using loop when you use SQL Server or any other tabular database.


    signature   Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]    [Linkedin]



    Sunday, September 8, 2019 6:56 AM
    Moderator
  • Thanks Ronen for your contribution. I was ONLY trying to help someone who is stuck with a problem with my simple MINDED solution. I am a simpleton you know maybe a complete IDIOT and MORON but I was not expecting some sort of grandiose self full fulfillment of ego by self bragging or some sort by criticizing of SOME SQL code as if it matter in any shape or form.

    Good luck. Sorry no time for chit chat and obviously not self fulfillment stuff... you get the idea! :)

    Soumen

    PS: BTW if you can not control yourself for something as simple as SQL code I start to lose faith on humanity but that's me!

    PPS: Never mind you won't get my drift...

    PPPS: Rule number 1, don't criticize ANYONE if you can not provide ANY SOLUTION to the POH (Problen on hand) in any shape or form. Jeez

    PPPPS: There are other rules trillions more but I don't want to overwhelm you.

    P...S: #2 Never get into a discussion where you are not involved. I was talking to him, NOT you. Why did you butt in? Nevermind...you won't get something as simple as that. Just don't butt in ok? EVEN IF I AM COMPLETE WRONG. You are not involved. Basic civility. Jeez.












    Sunday, September 8, 2019 7:05 AM
  • insert @names vallues ('Fred Bolg', 'Fred''s dog food')

    In addition to Ronen's comments, this statement has a problem with missing parentheses. It should be:

    insert @names vallues ('Fred Bolg'), ('Fred''s dog food')

    I point this out, because while wingers easilly should see the errors with vallues, he/she may not be able to correct the missing parens if he/she is not familiar with that syntax.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    Sunday, September 8, 2019 9:42 AM
    Moderator
  • Buddy you are very well aware that this is all preliminary that is no one has access to his server and therefore we can only assume HOW to code for him. I could not test my code. How could I? I just wrote something at one stretch and of course didn't pay attention to cross the t's and dot the i's as Ronen is pointing out. At first I wanted to say 'create a while loop and do it' then I remembered he said he was not good at sql, so I went ahead and created some script etc offhandedly. Cheers,

    Soumen







    Sunday, September 8, 2019 9:46 AM
  • Buddy you are very well aware that this is all preliminary that is no one has access to his server and therefore we can only assume HOW to code for him. I could not test my code.

    I am well aware of this situation. I've been there many times.

    As I indicated, I pointed out the error, to help Wingers in case he/she would give it a go at your solution.

    By the way, I have made that error myself many times when I want to insert many rows in a one-column table. I more often forget the parens than I remember to include them.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    Sunday, September 8, 2019 10:09 AM
    Moderator
  • @Soumen Barua

    Thank you for your input - I appreciate it.  Sorry you got hassled for trying to help me

    @All

    Thanks for all the responses, this is clearly not a forum for newbies in SQL like me to ask questions it would appear, as everyone here is at a much greater level of understanding and seem easily irritated by others.  But I do appreciate the replies, but this time it ended up much easier for me to just use something as silly as mailmerge to create a long script repeating above code but replacing 'name' with an entry from my list.  Once Erland told me how to cope with ' in names as well this ran and did the job I needed much quicker than me trying to learn something I am struggling with

    Thanks again


    Darren Rose

    EDIT : Marked as answer - even thought I know not an ideal answer, but it was how I solved it this time, due to lack of understanding as to other suggestions/replies


    • Marked as answer by wingers Sunday, September 8, 2019 6:39 PM
    • Edited by wingers Sunday, September 8, 2019 6:40 PM
    Sunday, September 8, 2019 11:18 AM
  • Thanks for all the responses, this is clearly not a forum for newbies in SQL like me to ask questions it would appear, as everyone here is at a much greater level of understanding and seem easily irritated by others.  

    Actually, this is the right forum for newbies but sometimes answerers overlook that this is a "Getting Started with SQL Server" forum and question askers may have little knowledge of SQL Server. Even when answers are rude, please don't take the tone personally as people answering are usually are trying to help you reach a solution and help you gain knowledge in the process.



    Dan Guzman, Data Platform MVP, http://www.dbdelta.com

    Sunday, September 8, 2019 11:50 AM
    Moderator
  • @Soumen Barua

    Thank you for your input - I appreciate it.  Sorry you got hassled for trying to help me

    @All

    Thanks for all the responses, this is clearly not a forum for newbies in SQL like me to ask questions it would appear, as everyone here is at a much greater level of understanding and seem easily irritated by others.  But I do appreciate the replies, but this time it ended up much easier for me to just use something as silly as mailmerge to create a long script repeating above code but replacing 'name' with an entry from my list.  Once Erland told me how to cope with ' in names as well this ran and did the job I needed much quicker than me trying to learn something I am struggling with

    Thanks again


    Darren Rose

    Hi Darren,

    This is exactly the place for newbies (as well as for experts) to get help in learning. This thread become too long without any reason. It should have been ended in two responses as most threads do, if you simply helped us to help you!

    Question -> (1) request for missing information -> (2) answer

    Instead we spending time on irrelevant discussion where all try to help you and you simply ignore all attempts😢 

    The first response you got was a request to provide missing information and since you still ignore the request to help us to help you and no you blame these who came to help you that do not ?!? 

    Let me ask once more, and with this I will withdraw my personal attempt to help you if you do not do your part. This is my past attempt to help you here.

    PLEASE PROVIDE:

    1) Queries to CREATE your relevant table(s) including indexes
    2) Queries  to INSERT sample data.
    3) The desired result given the sample, as text or image of excel for example.
    4) A short description of the business rules, and how you got 1-2 of the results
    5) Which version of SQL Server you are using (this will help to fit the query to your version).

    Note: to clarify I added the word "relevant". We do not need to reproduce the entire database but only the issue which relevant to the question. In fact, this not must to be queries to create the real table fully but a sample table(s) in order to reproduce the relevant issue. 

    and please be polite to these who contribute their time to help you free without any reward (hopefully a thanks will be the reward) !

    In any road you choose, I with you good luck in solving your needs

     

    p.s.

    Telling someone that his solution is bad and spending time in trying to help him to learn and to understand what was wrong, so he will improve his ability in the future, is not being hassled! Responding with "Why did you butt in" (and other responses) in open public community forum where someone chose to post his message in public is being hassled and rude which is why I did not respond to him.


    signature   Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]    [Linkedin]


    Sunday, September 8, 2019 5:40 PM
    Moderator
  • @ Ronen

    Let's just close it here shall we, as I have solved problem another way as I said

    I have however said thanks more than once, and I do appreciate ALL responses made, it doesn't help that SQL is not my area so I couldn't give all the information you asked for

    I did though answer the questions I knew answers to and explained clearly above that I didn't know answers to some of what you asked - I will repeat them below

    1) This is a database created by a piece of software a company uses it - it is quite a complex database and I have no idea how to recreate it using CREATE as the relevant tables are quite numerous as per the query I posted

    2) I don't manually INSERT data to it so not sure why relevant? the app does it as it is uses the database to store the data etc - I have no need to create INSERT statements for it, hence why I said so earlier

    3) explained several times above I believe?

    4) as above - but can't give rules as to 1 and 2 when I can't answer them

    5) again answered above - 2012 Express

    Sorry if anyone taken offence, but as a newbie I didn't understand some of your questions let along have the knowledge to answer them - hence my lack of responses, although I do think I did explain more than once I don't understand.

    Thanks again for all your help and replies, but as I say I have fixed it as per above reply - so job done this time


    Darren Rose

    Sunday, September 8, 2019 5:48 PM
  • I am glad to hear that you found a solution which fit your needs, and I am sry I could not help more/better.

    I hope that we will be able to help you better/more next time.

    Please close the thread by marking one or more of the responses as an answer. If there is no response which fit as answer in your opinion then you can mark your last response where you explain that you found a solution

    Have a great day Darren👍

      

    By the way,
    * The reason i kept trying to help is that you said thanks all the way😃
    * I asked if you know to create table and insert data using queries, and I did not realized from your answer that there is something in my request which you do know how to do.


    signature   Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]    [Linkedin]

    Sunday, September 8, 2019 6:36 PM
    Moderator