Change datestamp in SQL to new format
What is the best way to convert a date from
2022-04-19 12:00 to 4/19/2022 12:00 AM
This is the code im using for the YYYYMMDD but would like it to be the other way
SELECT
follow_up_id
, aa.description Contact_Channel
,comm_id
,da.login_name
,manager_login_lvl_1 tm
,manager_login_lvl_2 gm
,ds.site_short_name
,SUBSTRING(creation_date_lcl,1,length(creation_date_lcl))
,SUBSTRING(follow_up_due_datetime,1,length(follow_up_due_datetime))
from bsinsight.FACT_FOLLOW_UPS_RESCHD_EU ffr
left join bsinsight.dim_agents da on ffr.agent_skey = da.agent_skey
left join bsinsight.dim_sites ds on ds.site_skey = ffr.site_skey
left join bsinsight.dim_cs_routing_skills dcrs on ffr.routing_skill_skey = dcrs.routing_skill_skey
and ffr.marketplace_skey = dcrs.marketplace_skey
left join bsinsight.dim_day dd on ffr.fp_creation_date_utc_skey = dd.CAL_DAY_SKEY
LEFT JOIN bsinsight.dim_contact_type aa on aa.contact_type_skey = ffr.contact_type_skey
where ffr.marketplace_skey in (35)
and UPPER(ds.site_rollup) in ('ISSITE')
and lower(dcrs.datt_hierarchy_name)='customer'
and trunc (ffr.creation_datetime_utc) between TO_DATE('{RUN_DATE_YYYYMMDD}','YYYYMMDD')-8 AND TO_DATE('{RUN_DATE_YYYYMMDD}','YYYYMMDD')-1
AND is_resolved = 0
group by 1,2,3,4,5,6,7,8,9
Many thanks
How many English words
do you know?
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
how many words do you know
Powered by Examplum