Comparing Time Stamps

  • The application my db is tied to allows the user to select times for filtering the data (for example, task begins between 04:30 and 11:00, and task ends between 15:00 and 16:00). The task data is stored in the database as a datetime field, and I'm not sure how to compare the time portion of that field with the user-entered times. Any suggestions?

  • I got this to work using a simple CONVERT statement to retrieve the time portion of the datetime field.

    CONVERT(VARCHAR(8), timefield, 108)

    This seems to suit my purpose quite well, although there may be a better way.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply