- Posts: 25
- Thank you received: 2
Ask the community, share ideas, and connect with other LimeSurvey users!
Insert INTO [Limesurvey].[dbo].[tokens_table] ([Limesurvey].[dbo].[tokens_table].firstname, [Limesurvey].[dbo].[tokens_table].token, [Limesurvey].[dbo].[tokens_table].email, [Limesurvey].[dbo].[tokens_table].emailstatus, [Limesurvey].[dbo].[tokens_table].language, [Limesurvey].[dbo].[tokens_table].remindersent, [Limesurvey].[dbo].[tokens_table].attribute_1, [Limesurvey].[dbo].[tokens_table].attribute_2) select location, cast( '' as xml ).value('xs:base64Binary(sql:column( "token" ) )', 'nvarchar(MAX)' ), email, emailstatus, [language], remindersent, attribute_1, attribute_2 from ( select RTRIM([[Closed_Orders_For_Survey].[Franchise Location]) location, crypt_gen_random(10) as token, [Closed_Orders_For_Survey].[Email] email, 'OK' emailstatus, 'en' [language], 'N' remindersent, [[Closed_Orders_For_Survey].[Order Number] attribute_1, CONVERT(VARCHAR(10), [[Closed_Orders_For_Survey].[Invoice Date],110) attribute_2 from [[Closed_Orders_For_Survey] where [[Closed_Orders_For_Survey].[Order Date] >= dateadd(DAY, -1, Convert(date, GETDATE())) ) as x END