Hi,
I need to use a date stored in a string field to do some queries.
In the specific case, I need to select contacts 10 days before a policy expiration date.
The expiration date is stored in a string field so I can't use the formula SubDays(,).
Is it possible to read the string field as a date? I use ToDateTime but doesn't work.
Thanks
E.
Views
Replies
Total Likes
Hi @ElisabettaPi ,
Considering your string field has date format as MM/DD/YYYY, You can use DaysDiff() functionality instead of SubDays().
In Query, To fetch recipients who has policy expiration date after 10th day, add the condition as below
DaysDiff(ToDateTime(@your_string_field),DateOnly(GetDate()) ) EQUALS TO 10
Views
Replies
Total Likes
Hi,
thanks for your answer.
I tried your solution but it didn't work.
The error is: Invalid input syntax for type timestamp: " ".
The string date has this format "2024-08-27" without time, it is a text field.
I don't know if you have other suggestion for me.
Thanks a lot.
E.
Views
Replies
Total Likes
DaysDiff(ToDateTime(@stringField),DateOnly(GetDate()) )
@ElisabettaPi , The Same worked fine for me with date format as 2024-08-27 .
Views
Replies
Total Likes
I don't know why didn't work for me
Views
Replies
Total Likes
Views
Replies
Total Likes
I tried but the error is the same specified in the comment above.
Views
Replies
Total Likes
@ElisabettaPi which RDBMS you are using for Campaign database or for the table where this string field is stored?
Views
Replies
Total Likes
Hi, the field is in the Recipient table.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies