Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Connect to data source through SQL Statement

Hello,

I am trying  to connect to snowflake data source but through sql statement like below,

 

dharanisrees_2-1670786122884.png

 

and am getting this,

 

 

dharanisrees_1-1670785798151.png

 

my sql statement is,

 

select loan_acct_id, loan_current_status, approved_amount, channel, to_date(to_timestamp(funded_on, 'YYYY-MM-DD HH:MI:SS')) as funded_on_ from prod_datalake.datamart.vw_dim_loan_loan_status
where loan_current_status = 'Loan Funded' and channel = 'In Network' and funded_on_ = current_date();

 

What is going on wrong here!!

Please do help!!

 

Thanks,

Dharani

2 REPLIES 2
v-jialluo-msft
Community Support
Community Support

Hi @Anonymous,

 

According to your description, your question is that the SQL statement went wrong.

It may be that there is an error in this part of the statement:

to_date(to_timestamp(funded_on, 'YYYY-MM-DD HH:MI:SS')) as funded_on_

You can try:

select 
loan_acct_id, 
loan_current_status, 
approved_amount, 
channel, 
to_date(funded_on) as funded_on_date
from prod_datalake.datamart.vw_dim_loan_loan_status
where loan_current_status = 'Loan Funded' and channel = 'In Network' and funded_on_date = current_date();

 

Best Regards,
Gallen Luo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi,

 

This query perfectly works in the snowflake.

funded_on column is in text with timestamp. I wont be able to use to_date directly on the funded_column

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.