Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Delete Sql query using MS-Access database

Pratik1996
6 - Meteoroid

Hi ,

Scenario is :

1: First i append the records in .accdb file.

2 Now I need to delete & append the records from .accdb file by passing Date.

3 If Date is matched with existing records, it should delete those records & add new data in file.

4 How to write Delete sql query where Date is dynamic (user given date).

5 If any other way to achieve task ? 

4 REPLIES 4
jdminton
12 - Quasar

You should have an output that shows the database as the file you are connecting to and select the table you are trying to append. For the records needing appended, pass those through in the Alteryx workflow. Do not include the records needing deleted. For those needing deleted, you will need to use the Pre Create SQL Statement in the output tool. Click the three dots to the right of the box.

Snag_34fb2028.png

 

Once that opens, you use the statement:

DELETE FROM [Table Name] WHERE [Date] = 12/31/2022 (or whatever date you want to use. it will be replaced by the user.)

 

You will then need to make your workflow an analytic app. Then you can set a text box or something to receive the user entered data. Set the action box to update the date part of the string to the user entered date.

Pratik1996
6 - Meteoroid

Hi,

 

Thank you for your solution.

 

I have tried using same workflow, but didn't workout. it only appending the records without deleting the data as per date. could you share any other workaround to solve this issue !

 

 

jdminton
12 - Quasar

Can you please share what you tried? It might be a syntax issue. You might also need to add ' around the date. You should be able to share the workflow without sharing any data. That might help as well.

Pratik1996
6 - Meteoroid

I really appreciate your help, but I am not able to upload any file/img. because of of code of conduct .

I will check again what you have mentioned.

 

Thank you.

Labels