realrx7
realrx7

Reputation: 129

SQL Between Dates- Format an Issue?

I am trying to pull dates using the BETWEEN function, but was wondering if the format made a difference. The format that the dates are in now is 'mm/dd/yyyy'. I have seen a lot of examples that have the format in 'yyyy/mm/dd'. Can I pull the data using the format I have now, or do I need to convert the format? Thanks everyone.

Upvotes: 0

Views: 9212

Answers (2)

Brandon Kreisel
Brandon Kreisel

Reputation: 1646

I think what you want is:

Select EmailAddress,Birthday From table1 Where Birthday Between to_date('01-01-1946','MM-DD-YYYY') AND to_date('01-01-1988','MM-DD-YYYY');

Upvotes: 1

Randy
Randy

Reputation: 16673

the between clause should not have any formatting on the dates at all.

as in

BETWEEN start_dt AND end_dt

Upvotes: 0

Related Questions