473,387 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Conversion problem with SQL Server 2005???

Hi,
I am currently working on a .Net 2005 program with a SQLServver 2005 as my main database and I have a weird problem with date. When I insert the data in with the dates everything looks fine ( I insert using the date time format like it should)

Now when I try to search the records I get a really weird problem. It seems that I need to put the dates in my query as Y-D-M format!

I tried directly in SQL Server Management Studio with a query like this one
'SELECT * FROM T_Formation WHERE DateFormation >= '2006-12-18' and I get an error. If I do "SELET * FROM T_Formation WHERE DateFormation >= '2006-28-12' However, I get the results just fine.

In fact, when I use a Simple Store Procedure like SELECT * FROM T_Formation WHERE DateFormation >= @Date I get what I want. However, my query can't be that simple because I have multiple criterion which can be present or not, so I use a variable @Select which I fill with conditions until I have what I need and this is where it stop working.
Anyone know what to do?
Jan 10 '08 #1
1 1017
Nevermind that. I found a solution to this problem.
I used the SET DATEFORMAT ymd before executing the statement and it corrected the situation.
Jan 10 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Greg Strong | last post by:
Hello All, Hello All, What are the ToDo's / Gotchas to convert an MDB Access 2K2 database to an Access Project (i.e. ADP) file for the front end using Microsoft SQL Server 2000 Desktop Engine...
14
by: junky_fellow | last post by:
Can anybody please explain this: When a value with integer type is converted to another integer type other than _Bool, if the new type is unsigned, the value is converted by repeatedly...
0
by: Andre Ranieri | last post by:
This is a followup post to my earlier question regarding conversion from 1.1 to 2.0. I've been using VS 2003 for a couple years now but recently downloaded VS 2005 beta 2 to evaluate and learn. ...
9
by: Vince | last post by:
Hi all, I am trying to convert a VB 6 application to VB.NET 2005 using the wizard. It has over 20 forms and I've used Option Explicit everywhere, hence variables are properly declared and used....
1
by: Michael Tissington | last post by:
I'm trying to convert a project from VS2003 to VS2005 After conversion all of my TagPrefix are not recognized in the body. <%@ Register TagPrefix="Oaklodge" TagName="Curve"...
1
by: JayCallas | last post by:
I have created an SSIS (think that is what DTS is called now) package to run on a SQL 2005 server. It's job is to connect to a SQL 2000 server, execute a stored procedure, and insert the returned...
0
by: Rich | last post by:
I am converting my enterprise solution from VS 2003 (.NET v1.1.4322) to VS 2005 Professional (.NET v2.0.50727). The entire solution currently uses the following technologies - Windows Server 2003...
4
by: jim_geissman | last post by:
I have data tables that include ZIP code, as char(5). The values look like integers, but they are padded with leading zeroes to fill out 5 characters, '00234'. There are SPs to look up data,...
3
by: pb648174 | last post by:
I recently needed to upgrade a sql 2000 machine to 2005. Instead of upgrading the sql 2000 default instance, I installed sql 2005 as a separate named instance so we could go back to sql 2000 if...
5
by: Ivan Velev | last post by:
Hello, Minimal example below - it gives me different output if I comment / uncomment the extra time.mktime call - note that this call is not related in any way to main logic flow. When...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.