Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Unanswered

How to use fn_UTCToTzCodeSpecificLocalTime

Posted on by 120

I need to get my records after checking Utc time zone ,I have a gap of 2 hours between my CRM and DB. I am trying to use fn_UTCToTzCodeSpecificLocalTime but my query takes long time and I'm not sure that I'm using it right.
The need is
1- to use the date according to CRM and not DB .
2 - I need to make sure this date is before june 2022. 
What am I missing ?
This is my  query:

l

select distinct top 5 accountnumber,bci.CreatedOn

from AccountBase ac
join bcis bci on ac.AccountId = bci.PayingAccountId

where

 convert(varchar, dbo.fn_UTCToTzCodeSpecificLocalTime(bci.CreatedOn,135)) < '2022-06-01'

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans