Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. craigward

    Cross table insert duplicate key issue

    Could I ask, do you rate this method of selecting the distinct records? I was playing with it but will use the method using the merge but curious to get your opinion. Thanks. SELECT customerid, billingemail, rk FROM ( SELECT customerid, kk.billingemail...
  2. craigward

    Cross table insert duplicate key issue

    Thank you Olaf, that was a great explanation. I understand all you said there it makes good sense. The numeric id for a varchar(50) was just in the test table in the live system this field in numeric, not sure why I didn't correct this in the test example above. I will run some tests and this...
  3. craigward

    Cross table insert duplicate key issue

    Thank you fredericofonseca, does Distinct not look at all columns in the row to make sure each value is distinct? I need to add another 10 columns into the query that are not sample code. Thanks again.
  4. craigward

    SQL Merge Into Help

    Thanks Olaf.
  5. craigward

    Cross table insert duplicate key issue

    Hi, I have 2 tables, wce_contact and PC_WiredOrder. I want to copy data from PC_WiredOrder into wce_contact, that is not difficult. The issue comes when the PC_WiredOrder table has duplicates in it, it then conflicts with the unique primary key in the wce_contact table. That is because i'm...
  6. craigward

    SQL Merge Into Help

    Hi, I use the following script to merge data from one table into another. This works fine 99% of the time. The issue I am having is that on occasion the data in in the source table pc_wiredorder holds multiple records with the same customerid, which is merged into the destination table...
  7. craigward

    No response from API

    The actual fix after removing the duplication was to add this to my script. This fix came from your link http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/ there are two solutions here. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); Here is the...
  8. craigward

    No response from API

    Thank you both for looking into this, there was a duplication of that code which I have now removed. Tested again and still no results in my two windows environments. Feherke, Thank you for testing it in Ubunto that at least verifies that the code is working and that there must be a problem as...
  9. craigward

    No response from API

    Hi, I am new to PHP and am trying to connect to a JSON API where I will retrieve some data from a property booking system. The API provider provides sample code see below, you just add your API Key and Property ID, when the code is loaded you should see the property details in JSON format. I...
  10. craigward

    Ajax JSON API Connection

    I'm seeing that too, the beds24 support say they allow cross-domain JSON requests ,they said 'e include the following header "Access-Control-Allow-Origin: *"' I added this but still see the error..... I'm pulling my hair out on this one, tried so many things. any one got any other ideas?
  11. craigward

    Ajax JSON API Connection

    Hi, Yea it is jQuery but can't find a specific forum. I moved the scripts into the body. Still not adding the property and no errors. This is the console output once the script is run. I don't know much about API responses but that looks about what I would imagine. Any more thoughts? Request...
  12. craigward

    Ajax JSON API Connection

    Hi I am trying to connect to a JSON API using Ajax located here https://api.beds24.com/json/ I want to be able to retrieve property data, add new and update existing properties which can all be done with this API. Problem is I have never used an API before and am going round in circles after...
  13. craigward

    SUM rows where value = DT

    Thanks for your reply. So when I run this I see in the @UnprocessedQuotes table the quote number 2959. Are you saying integrate this with the script you created that sets the values as I need them in the sub_total fields?
  14. craigward

    SUM rows where value = DT

    Thanks Dave, that is great, thank you for your help! Can I trouble you with another question. I have applied your script to a particular quote number '2959' so it does the math for that quotes line items. The table has many quotes in it and new quotes (with unique quote numbers) added daily. Is...
  15. craigward

    SUM rows where value = DT

    wHi There, I hit an issue today that I am scratching my head with, any guidance would be much appreciated. I am trying to come up with a query that SUMS all the rows 'Total_After_Discount' field values above and including when the row where the value in the quote_print = 'DT is found and for...
  16. craigward

    Not Exist Query including a row that should not be there.

    It look like my logic was wrong! My original query to avoid a property booked between two dates. SELECT U.uniqueid, U.WCE_UID as propname, wce_DisplayName FROM wces_users AS u WHERE u.WCE_DEPARTMENT = 'Accommodation' AND NOT EXISTS (SELECT a.SCHEDULEFOR FROM dbo.wce_activity_temp AS a...
  17. craigward

    Not Exist Query including a row that should not be there.

    Thanks for looking. Maybe this logic has my head confused. Let me ask the question in a different way. As I understand the not exists query below should return 4 out of the 5 results as they do not have a start or end date that conflicts with the following booking requested. So the new booking...
  18. craigward

    Not Exist Query including a row that should not be there.

    Hi, excuse me if this is a little hard to follow. I have a table that stores bookings for properties called wce_activity_temp, this holds the property name and the start and end dates etc. I have another table that stores the properties names and some other bits realted to the properties...
  19. craigward

    ASP to .VBS

    Hi Guitarzan, Thank you so much for your advice, that worked perfectly! Thanks again.
  20. craigward

    ASP to .VBS

    Hi, think this is the right forum?! I have a classic ASP script that works a treat to calculate directory sizes and write them back to a database, code below. The problem I have is I need to run the script in task scheduler on Windows server which you can't do with a .asp file. Apparently a .vbs...

Part and Inventory Search

Back
Top