Solved

T-SQL convertion

Posted on 2013-05-14
2
232 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Job - date manual 1 43
Substring works but need to tweak it 14 31
SQL server client app 3 32
SQL profiler 3 18
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

726 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