SET DATEFORMAT Dmy
Jul 31, 2007
I want to post a date and search a date
I posted 01/08/07 and it went into my database like this: 08/01/2007
then I posted 15/08/07 and it went in like: 15/08/07
I have put SET DATEFORMAT dmy in the INSERT INTO and SELECT SQL statements
now i get: [Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
/pubspace/events.asp, line 96
line 96: SET DATEFORMAT dmy SELECT * FROM members INNER JOIN (pubs INNER JOIN tEvents ON pubs.PubID = tEvents.PubID) ON members.UserID = tEvents.UserID WHERE Start_Date = '" & dDate & "' ORDER BY eventTime "
View 20 Replies
ADVERTISEMENT
Jan 24, 2004
HI FRIENDS,
I AM FACING ONE DATE RELATED PROBLEM.
MY Problem is that i want retrieve date from sql in dd/mm/yyyy format.
i know that through convert fn , it is possible.
but i want to retrieve date in specific format untill the connection is made with sql-server.
I tried by using set dateformat dmy
then i fired query
like select getdate()
but i am not geting required output
hope u geting me.
i urgely wait for yours reply.
Thanking u
dhiraj
View 8 Replies
View Related
Dec 28, 2005
Hello,I receive a file containing some character fields along with a date.The date values in the file are formatted as "dd/mm/yy", that is2-digit day, 2-digit month, and 2-digit year. The separator could beslash or a dash ("-"). The file is in a proprietary format, and bcp isnot an option.So, I decided to load the file using a prepared statement. I open acursor with an INSERT statement, read from the file, parse out values,and put it in the database using the cursor. All is OK; except thatthe date values are mangled. This is despite the fact that I am issuinga "set dateformat dmy" before running the INSERT statement.It seems that the "set dateformat dmy" is not being accepted, or it isbeing ignored. I set it at the beginning right after opening aconnection to the database. From what I understand, it should work.Am I doing something wrong? Any suggestions on how to get this towork?Thanks!
View 4 Replies
View Related
Jul 12, 2001
How do I find out the current setting for Dateformat?
I know how to set it, just don't know how to find out what it currently is.
Thanks in advance!!
View 2 Replies
View Related
Jun 9, 2008
Hi
I have fields with this dateformat:
2002-10-09 10:03:00.000
And I want to change to this:
2002/10/09 10:03:00
I've been looking at the help function, but can't seem to find this exact format. Any suggestions??
Thanks!
View 4 Replies
View Related
May 22, 2008
Hi, I have a date field in the report, I want to convert its format to string like this: 22-May-08
I tried to use FormatDateTime function but it doesn't have much option.
What is the best way to do that?
thanks
View 4 Replies
View Related
Oct 10, 2007
Hi
I got a SQL Server with Language = €śGerman€? and Collation = €śLatin1_General_CI_AS€?.
My application has a form with language = €śEnglisch€?. This application is calling an stored procedure, that has a datetime parameter.
db.AddInParameter(dbCommand, "@Test", DbType.DateTime, Test);
This stored procedure is not able to accept the value from the parameter, because the application is passing it, in the format ymd and sql server is specting it in ydm.
I tried to set the dateformat = ymd in the store procedure, thing that did not work. I have to set it before exec my-stored procedure. But I cant from my application.
How can I solve this?
View 3 Replies
View Related
Jul 27, 2007
Hi,
I am having the ReportDate='1998-12-31 00:00:00.000'
I need in the format 'mm/dd/yy hh:mm AM/PM'
can you please tell me the Expression for this format.
Thanks
Dinesh
View 7 Replies
View Related
Apr 14, 2008
When I write a query getdate() the aviliable date format is yy-mm-dd
But I need in dd-mm-yy, so how can I get this.
Am getting in all the ways i.e, mm-dd-yy, yy-dd-mm and yy-mm-dd except dd-mm-yy. pl send the ans ASAP.
Thanks in advance
View 6 Replies
View Related
Nov 9, 2007
Hi,
Are there any know performance problems with using the command SET DATEFORMAT dmy in SQL Server 2000 stored procedures? The reason I ask is because a particular stored procedure is taking 750ms to execute, yet when I remove 'SET DATEFORMAT dmy' line the execution times only takes 20ms (as in twenty - no typo). I mean that's a massive difference, why does SET DATEFORMAT command do this, is there a faster alternative?
As for the sProc itself it does a DateTime comparison on a VarChar field that stores a date time value (yes, I know it's not very well normalised/typed), eg.
AND b.value >= GetDate()
...where value is a VarChar field.
Thanks for any help! :)
View 4 Replies
View Related
Aug 17, 2007
Hi,
I want to change the default date format from 'mdy' to 'dmy'. I can do this for session by using
SET DATEFORMAT 'dmy'
but I want to this permanent on Database level (preferred) or SQL instance level how can I do this?
Thanks in advance
View 1 Replies
View Related
Nov 28, 2007
hai,
i have a report with date formats,numbers, percentages,when runnig the preview it successfully those are visible in preview, but problem is when iam importing report into excel , those date formats,numbers,percentages are not visible in excel sheet. instead of date formats, numbers, percentages, cells are empty and cells not contain any data like dateformat , number,percentage.
so please help me because i have only one day for delivering repport,
i hope any body save me this problem, iam giving advanced thanks to our forum members.
james v jack
View 3 Replies
View Related
Jan 31, 2008
I can't create a function which contains SET DATEFORMAT dmy (Greek dateformat). Does it only work in a SP?
View 11 Replies
View Related