I have been trying to convert my old access sql to sql server but after several hours have given up for now. Is there a tool to do this or failing that can someone convert this to SQL Server sql
Web Development Manager
Code:
SELECT DISTINCT vouchers.ID as vid, vouchers.*, merchants.merchants_logo, merchants.merchants_id, merchants.merchants_name, merchants.merchants_display_name, voucher_type.*
FROM ((((merchantscategory
INNER JOIN merchants ON merchantscategory.merchants_id = merchants.merchants_id)
INNER JOIN vouchers ON merchants.merchants_name = vouchers.program_name)
LEFT JOIN voucher_type_lookup ON vouchers.ID = voucher_type_lookup.ID)
LEFT JOIN voucher_type ON voucher_type_lookup.voucher_type_id =voucher_type.voucher_type_id)
LEFT JOIN category ON merchantscategory.category_id = category.category_id
WHERE (merchants.merchants_id = @merchants_id OR @merchants_id = -1)
AND (IIF(ISNULL(vouchers.vouchers_category_id), merchantscategory.category_id = @category_id OR @category_id = -1, vouchers.vouchers_category_id = @category_id OR @category_id = -1))
AND ((program_name like '%'+@searchterm+'%' OR vouchers.description like '%'+@searchterm+'%' OR @searchterm='-1') AND (IIF(ISNULL(vouchers.vouchers_category_id), merchantscategory.category_id = @searchterm_category_id OR @searchterm_category_id = -1, vouchers.vouchers_category_id = @searchterm_category_id OR @searchterm_category_id = -1)))
AND merchants.merchants_inactive = False
AND end_date >= Date()
AND start_date <= Date()
ORDER BY start_Date DESC
Web Development Manager