I don't think you can use something like this "23:59:59 pm" as it does not seem to be a valid time format. When you say 23:59:59, you should not specipy "pm" there.
As you said the dates are stored in 12 hrs format, that is how the SQLServer stores the date values. But it provides you with a lot other formats with which you can query up on the date columns. Convert function is used to get any of those formats.
For example, when you want to pass the date values in 24hrs format as parameters, you can always use yyyy-mm-dd hh:mm:ss.mss format in your case, where value for hh can range from 00 - 23.
BeginningDate As DateTime = "2004-03-15 12:00:00.000"
EndingDate As DateTime = "2004-03-15 12:59:59.000"
Select Convert(varchar(25),getdate(),121) - gives you the format that is specified above.
Hope that helps.