Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

How to you write a date time filter statement using the filter tool in In Database tool?

jthompson789
8 - Asteroid

I really new to writing SQL statements and I'm not sure where to start with writing the proper syntax using the filter tool inside the In Database Tool.

I want to write a filter that will look between two times of the same day. Example: 2018-08-09 17:00:00 to 2018-08-09 20:59:59.

Any suggestions will be of great help.

 

4 REPLIES 4
MarqueeCrew
20 - Arcturus
20 - Arcturus
For syntax, use a google search like:

"Oracle where date between"

Change oracle to your database RDBMD and see what it comes back with.

Use the stuff after the where in the SQL

Cheers,
Mark
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
ramatp30
7 - Meteor

in Oracle it looks like:

 

select * from tab1 where timestamps between to_date('Startdate1',dateformat) and to_date( 'Enddate2',dateformat)

 

It can also be like 

 

select * from tab1 where timestamps >=to_date('Startdate1',dateformat) and timestamps <= to_date( 'Enddate2',dateformat)

 

You can google it for correct syntax.

tcroberts
12 - Quasar

The people above seemed to have answered for Oracle, so I'll just chip in for Microsoft SQLServer:

 

SELECT *

FROM YOUR_TABLE

WHERE [DATE] BETWEEN '2010-01-01' and '2999-12-31'

 

 

above, you'd replace '2010-01-01' and '2999-12-31' with your start and end dates respectively

jthompson789
8 - Asteroid

Thank you for the suggestion ,it has solved by problem. 

Labels