SQL paramaters

25 pts.
Tags:
SQL Database
Visual Studio
How do I input a date for query to an SQL database from Visual Studio.
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • carlosdl
    Please provide more details about what you are trying to do.

    If you are talking about an application, then mention the language you are using (instead of Visual Studio, which is just an IDE), and show us your code, including the statement you want to parameterize.
    85,450 pointsBadges:
    report
  • carlosdl
    And by the way, SQL is a language, so if you are actually talking about "SQL Server", please make sure to make it clear.
    85,450 pointsBadges:
    report
  • Jerrymack

    Sorry guys I thought I was in a Visual Basic chat room. I was trying to query a SQL database using the Visual Basic Studio Manager.  This is not the exact code, but it is similar.

     

    SELECT STARTDATE AS stime

       FROM MESSAGE

           WHERE STARTDATE = @stime

     

    STARTDATE is a string, for example '2016-29-5 17:15:34.0'

    25 pointsBadges:
    report
  • ToddN2000
    Are you looking to select or input the date? Your example shows a select and the question is to input (insert). There are a number of ways but is all depends on the format for the date and the way the table has the column defined. Are you looking to just add a new row, update an existing row with the date?
    135,485 pointsBadges:
    report
  • Jerrymack
    I was able to resolve the problem via trial and error. It turns out the type was a string. Plus I needed to parenthesize correctly.
    Thanks for your questions, they lead me the correct answer.
    25 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: