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 7629605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:52:38+00:00 2026-05-31T05:52:38+00:00

I am having some issue here, and I am not too sure how to

  • 0

I am having some issue here, and I am not too sure how to handle it. If you could lead me in the right direction, that would be appreciated:

Private Function Convert2YearTo4Year(ByVal str_DTG2Year As String) As String

    Dim str_sys4Year As String
    Dim i_sys2Year As Integer
    Dim i_sys2Century As Integer

    str_sys4Year = Right(Str$(Of Date), 4)
    i_sys2Year = Val(Right(str_sys4Year, 2))            'value of system 2-digit yr
    i_sys2Century = Val(Left(str_sys4Year, 2))          'value of system 2-digit century

    If Val(str_DTG2Year) < i_sys2Year And i_sys2Year - Val(str_DTG2Year) > 50 Then         'next century
        Convert2YearTo4Year = Trim$(Str$(i_sys2Century + 1) + str_DTG2Year)
    ElseIf Val(str_DTG2Year) > i_sys2Year And Val(str_DTG2Year) - i_sys2Year > 50 Then     'prev century
        Convert2YearTo4Year = Trim$(Str$(i_sys2Century - 1) + str_DTG2Year)
    Else
        Convert2YearTo4Year = Trim$(Str$(i_sys2Century) + str_DTG2Year)                           'current century
    End If
End Function

The error in the title of this post is flagging at Right(Str$(Of Date), 4).

  • 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-05-31T05:52:39+00:00Added an answer on May 31, 2026 at 5:52 am

    Remove Of.
    Of is used to pass generic type arguments.

    You should replace that whole line with DateTime.Now.Year.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not quite a windows lover and I'm having some issue here with guard
I'm having some issue with this query that seems to be too slow... SELECT
We're having a small issue and could use some help - we have the
I am having some issue here using LWP::Simple to get ftp site content in
I am having some issues trying to convert a double to C++ string. Here
Alright, I'm having some issues and I believe it's a CSS one. Here is
Having a strange issue with some C# code - the Getter method for a
I'm having an issue getting some code to work. Is there a way to
I'm having an issue with a query I wrote where for some reason the
I'm having an issue with my regex. I want to capture <% some stuff

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.