Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7994773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:12:57+00:00 2026-06-04T14:12:57+00:00

On my reporting application which is developed using SSRS 2005, I have a parameter

  • 0

On my reporting application which is developed using SSRS 2005, I have a parameter of type string which accepts time. the time should be in the format “HH:mm:ss” How can I check if the input string is of correct format?

I tried to do the following
IsDate(TimeValue(parametr!stime.Value))
This returns true as long as the value is within range. But if the value is 24:00:00 or a wrong value then an exception is thrown.

I also tried to create a function in the report code as follows:

Public Function CheckNum(sNum as String) as Boolean
Dim msg as String
msg = ""
Try
If IsDate(TimeValue(sNum))=1 Then
Return True
Else
msg="Parameter must be a number"
End If
Catch ex as Exception
Return False
End Try
If msg <> "" Then 
MsgBox(msg, 16, "Parameter Validation Error")
Err.Raise(6,Report) 'Raise an overflow
End If
End Function

And when I input a value 24:00:00 I still get an error

” The conversion of a char type to datetime data type resulted in an out of range date time value”
How can I handle the exception so that I don’t the error?

EDIT:

public Function CheckNum(sNum as String) as Boolean

Dim REGEX_TIME = "^(([0-1]?[0-9])|([2][0-3])):([0-5]?[0-9])(:([0-5]?[0-9]))?$"       
If System.Text.RegularExpressions.Regex.IsMatch(sNum, REGEX_TIME) Then
Return True
Else
Return False
End If
End Function

Then I assigned a parameter(validateTime) value as =Code.CheckNum(Parameters!sTime.Value)

But the value of the parameter is always true. When I specify a value greater than 23, I still see the error. Please see the image Error when time is invalid

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T14:12:58+00:00Added an answer on June 4, 2026 at 2:12 pm

    Instead of using IsDate function, use VB.NET regular expressions. SSRS allows full use of .NET functions.
    See an example of time regex.
    A good tutorial on regex.

    Example Code Console Application

    Imports System.Text.RegularExpressions
    
    Module Module1
    
        Sub Main()
    
            Dim REGEX_TIME = "^(([0-1]?[0-9])|([2][0-3])):([0-5]?[0-9])(:([0-5]?[0-9]))?$"
            Dim InputList As List(Of String) = New List(Of String)
            InputList.Add("25:00:21")
            InputList.Add("22:00:21")
            InputList.Add("AA:00:21")
            InputList.Add("17:21:02")
            For Each input As String In InputList
                If Regex.IsMatch(input, REGEX_TIME) Then
                    Console.WriteLine("TIME " + input + " IS OK")
                Else
                    Console.WriteLine("TIME " + input + " IS NOT OK")
                End If
            Next
        End Sub
    End Module
    

    Output is :

    TIME 25:00:21 IS NOT OK
    TIME 22:00:21 IS OK
    TIME AA:00:21 IS NOT OK
    TIME 17:21:02 IS OK
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed web application which uses JasperReports for reporting purpose. In that I
I have a reporting requirement in my web application for which I am looking
I have a windows service application which works using remoting. It is used to
Right now I have an application which uses Reporting Services to render reports. This
We currently have developed an application using WCF. Our clients make connections to different
I have a need to add business reporting for an application I am working
I am just wondering, should i build the reporting engine inside my web application
I have developed one application in android and now I wish to add one
I have been given the tasks of speccing a mobile application, which will need
I have an application which uses Webbrowser control to navigate to a few vendor

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.