Return before DECLARE. I am not sure if I am missing something, but I have DECLAREs as the beginning of my SQL. When I format it it is removing the carriage return and forcing these all onto one line. I have looked through the settings, but can't find anything to stop this from happening. Am I missing something?
Hi @jonnygabble, could you please post a code snippet and let me know which DB you have chosen in the General Tab?
Regards
Guido
I have chosen Azure as the database. Here is an example of the SQL before and after formatting.
DECLARE @start_date DATE='04-01-2021'
DECLARE @end_date DATE='04-30-2021'
DECLARE @supplier INT=10486 --Enter Supplier NumberSELECT
invoice_hdr.invoice_no,
invoice_hdr.bill2_name
FROM oe_line
INNER JOIN invoice_hdr ON oe_line.order_no=invoice_hdr.order_noWHERE
oe_line.supplier_id=@supplier
AND CAST(invoice_hdr.invoice_date AS DATE)>=@start_date
AND CAST(invoice_hdr.invoice_date AS DATE)<=@end_date
DECLARE @start_date DATE='04-01-2021' DECLARE @end_date DATE='04-30-2021' DECLARE @supplier INT=10486 --Enter Supplier Number
SELECT
invoice_hdr.invoice_no,
invoice_hdr.bill2_name
FROM oe_line
INNER JOIN invoice_hdr ON oe_line.order_no=invoice_hdr.order_noWHERE
oe_line.supplier_id=@supplier
AND CAST(invoice_hdr.invoice_date AS DATE)>=@start_date
AND CAST(invoice_hdr.invoice_date AS DATE)<=@end_date
FYI, just tested this and if I choose SQL Server it works as I would like.
Hi @jonnygabble,
many thanks for your feedback. Will improve the Azure Parsing accordingly.
Regards
Guido