Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Query in SQL Server 2005 Where in 2 column

$
0
0

Good day!! to all

im kinda stuck in here...

here is the senario

i have a table violation

with column of

ID (primary key)

DateCommitted (Date Time)

TimeCommitted (Date Time)

ViolationComitted (varchar(250))

im not the one who created the table im kinda maintaining the system

and the user wants to have a search type where they can search by date + time
eg. From: 01-01-2014 5:30PM to 02-10-2014 11:00AM

im kinda confuse how can i combine the two table in the where clause
where i can search with the date and time combine to get the proper result.
something like this.

SELECT * FROM Violation where ( DateCommitted +TimeCommittedBetween '01-01-2014 5:30PM' AND '02-10-2014 11:00AM' )

hope for your help guys.. thanks in advance!!



Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>