CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Aug 2011
    Posts
    9

    Question datetimepicker and sql

    .NET 4.0

    I have a simple between two datetimepicker query I am trying to implement. Could someone explain to me very simply without a parametrized query debate, how to make a datetimepicker's value appear in my query?

    SELECT punches.Number, punches.Punchdate, employees.Name
    FROM employees CROSS JOIN
    punches
    WHERE punches.PunchDate BETWEEN dateTimePicker1.Value AND dateTimePicker2.Value

    I realize that this is not the correct formatting.. I have tried quotes, @'s, .ToSmallDateString,DateTime.Parse(), and pretty much everything that I have been able to find on google... yet still I still get errors.. I realize how noob of a question this is...

    I also realize I cancel the rules of gravity for not using parametrized input on even the simplest of things.. However, I need baby steps first so I can get a better grasp of how to handle things first... Any input would be appreciated..
    Last edited by HackedGadget; August 24th, 2011 at 01:50 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured