First published on on Jun 08, 2016
Have you been wondering how to use DateTime inside of SqlFilters, with your Topics/Subscriptions? Have you also noticed that this doesn't seem to work?
That's because you explicitly need to add the DateTime as a parameter, like so:
In order to make this more searchable in the future, I have also added a corresponding StackOverflow question: http://stackoverflow.com/questions/37705333/azure-service-bus-using-datetime-in-topic-subscription-sqlfilter-in-net
Have you been wondering how to use DateTime inside of SqlFilters, with your Topics/Subscriptions? Have you also noticed that this doesn't seem to work?
var message = new BrokeredMessage();
message.Properties["datetime"] = DateTime.Now;
var sqlFilter = new SqlFilter("datetime > '2016-06-06'");
That's because you explicitly need to add the DateTime as a parameter, like so:
var filter = new SqlFilter(" datetime >= @datetime");
filter.Parameters.Add("@datetime", DateTime.Parse("2016-06-06"));
In order to make this more searchable in the future, I have also added a corresponding StackOverflow question: http://stackoverflow.com/questions/37705333/azure-service-bus-using-datetime-in-topic-subscription-sqlfilter-in-net
Updated Mar 15, 2019
Version 2.0AshishChhabria
Former Employee
Joined March 08, 2019
Messaging on Azure Blog
Follow this blog board to get notified when there's new activity