pass pure time to my query

Giganews Newsgroups
Subject: pass pure time to my query
Posted by:  iccsi (inun…@gmail.com)
Date: Tue, 16 Aug 2011

I have a datetime field which contains data like following:

03:15:00 PM
04:25:00 PM

I have a query and would like to query on this field like following:

Select myfield from mytable where mydatetime = @MyDateTime

I pass '03:15:00 PM' to the function.
For some reason, it does not return the record.
I tried to use convert(char(15), @MyDateTime, 108) which does not work
and tried to use cast which does not work either.

I would like to know how I can query a datetime field for pure time
information,
Your help is great appreciated,

Replies