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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:51:53+00:00 2026-05-20T00:51:53+00:00

hey guys, i want to convert datetime from string, i have string which contains

  • 0

hey guys,
i want to convert datetime from string, i have string which contains ‘GETDATE’ now i want to convert the same in datetime, the string in sql server is been defined as varchar(max)

Please reply how can i type cast the GETDATE() function from string to datetieme.

Regards
Abbas Electricwala

  • 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-20T00:51:53+00:00Added an answer on May 20, 2026 at 12:51 am

    I guess that you mean that you have a string that contains the text GetDate() like this.

    declare @S varchar(50)
    set @S = 'getdate()'
    

    And you want to turn that into a date variable executing getdate().

    You could do this since you know what what getdate() means.

    declare @S varchar(50)
    set @S = 'getdate()'
    
    declare @D datetime
    
    set @D = (select
                case @S when 'getdate()'
                  then getdate()
                  else null
                end)
    

    Does not really make sense, there probably is more to this than you are telling.

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

Sidebar

Related Questions

hey guys, i have a gridview which displays 10records per page, now i want
Hey guys I have an assigned array from mysql results and I simply want
Hey guys, I have an application that I want to display some data from
Hey guys. I have a method that gets called each second which I want
Hey guys, I have created a tree which is not a binary tree. Now,
Hey guys I have a question which is... I want a panel at the
hey i guys i want help from you. i am working on website project,
hey guys i want to fetch 3 tables in 1 single ado.net call from
Hey ,Guys ,I have a question. I want to transform the array. [[1, [-1,
Hey guys, I have a CS exam tomorrow. Just want to get a few

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.