Solved

T-SQL convertion

Posted on 2013-05-14
2
227 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
Comment Utility
between '2013-04-01' and '2013-05-10'

is all you need in TSQL
0
 
LVL 48

Expert Comment

by:PortletPaul
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 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

16 Experts available now in Live!

Get 1:1 Help Now