Solved

T-SQL convertion

Posted on 2013-05-14
2
230 Views
Last Modified: 2013-05-14
Dear all,

We have an oracle statement here and this will will execute in MS SQL side.

"to_date('2013-04-01','YYYY-MM-DD') and to_date('2013-05-10','YYYY-MM-DD')"

but I try to run it from MS SQL and see what takes it so long time to return.

how can I convert it to t-SQL ?
0
Comment
Question by:marrowyung
  • 2
2 Comments
 
LVL 48

Accepted Solution

by:
PortletPaul earned 500 total points
ID: 39163896
between '2013-04-01' and '2013-05-10'

is all you need in TSQL
0
 
LVL 48

Expert Comment

by:PortletPaul
ID: 39163909
I should add, if you prefer to be explicit regarding the date conversion, then you can do this instead:

between convert(date,'2013-04-01') and convert(date,'2013-05-10')

-- not sure about sql 2005, will work in 2008
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now