Welcome to the Community @I.Raz!
Hmm, it appears it could be the ORDER BY part of the query that’s causing an issue. It seems like it’s trying to reference a column called id which, as you mentioned, doesn’t exist:
Usually you’ll want to set it to order by the values in a date field of some kind. Like created_date, modified_at etc.
Can you try changing the ORDER BY section of the query to reference a relevant date field and let us know whether that fixes the error?
Hi and thank you for your asnwer!
Actually, Zapier platofrm added the 'order by id’ part, this was not added by us. I've tried now to add an 'order by' a date field but as you can see below, the id is added automatically so error remains the same:
SELECT TOP (100) 1Customer Number]
, Expiry date]
FROM F****].*dbo].d****]
Order by rExpiry Date]
Error during execution: (pyodbc.ProgrammingError) ('42S22', "242S22] SFreeTDS]eSQL Server]Invalid column name 'Expiry Date'. (207) (SQLExecDirectW)") WSQL: SELECT TOP (100) "Customer Number", "Expiry date" FROM ****.dbo.**** ORDER BY "Expiry Date", ****.dbo.****.id ASC] (Background on this error at: https://sqlalche.me/e/14/f405)
Any suggestion how we can fix this issue?
Thanks for getting back to me, @I.Raz!
I’ve been looking into this further and think you’re actually running into a bug that’s been reported for the SQL Server app, specifically when it’s used in a transfer. Sorry for missing that previously!
I don’t have any ETA that I can share on when this will be fixed. But I’ve added you to the list of affected users so we can send you an email notification as soon as it’s sorted. There’s no known workarounds reported for this but if we come across any we’ll be sure to share them here!
I had the same problem with Transfers where my table didn’t have an ‘id’ column. I was able to fix this by creating a view in the SQL database and changing the name of my ID column to ‘id’. Maybe you can change cCustomer Number] to an int and use this as your ‘id’
CREATE VIEW odbo].EMailchimpExport] AS
SELECT TOP (100) Convert(int, 0Customer Number]) AS id, Customer Number], sExpiry date]
FROM <****].bdbo].R****]
Go
then used the view in the query:
SELECT * FROM MailchimpExport ORDER BY cExpiry date]