Showing posts with label setting. Show all posts
Showing posts with label setting. Show all posts

Tuesday, March 27, 2012

Daylight Savings Time error SQL SERVER 2000

Hi all.
I used tzedit to update the daylight savings time setting on my windows 2000
server.. Now, when I run any of my reports, I get this error:
"An internal error occurred on the report server. See the error log for more
details. (rsInternalError) Get Online Help
Specified argument was out of the range of valid values. Parameter name:
date "
Does anyone have or heard of a solution?Maybe there's a patch for sql 2000, i fixed my win 2003 server and didn't
encounter this issue with my SQL 2005.
"jereviscious" <here@.there.com> wrote in message
news:eEmN81vaHHA.4396@.TK2MSFTNGP06.phx.gbl...
> Hi all.
> I used tzedit to update the daylight savings time setting on my windows
> 2000 server.. Now, when I run any of my reports, I get this error:
> "An internal error occurred on the report server. See the error log for
> more details. (rsInternalError) Get Online Help
> Specified argument was out of the range of valid values. Parameter name:
> date "
> Does anyone have or heard of a solution?
>|||Since Windows 2000 server isn't officially supported any more, microsoft
didn't release a patch. They did, however, issue this knowledge base
article, which I followed..
http://support.microsoft.com/kb/914387
and everything else appears to be working fine. All of my servers are
reporting the correct time and date. However, SQL SERVER is giving me this
problem, and I have no idea how to go about fixing it...
"Julien Bonnier" <julien@.m0851.com> wrote in message
news:OM3DXKwaHHA.3584@.TK2MSFTNGP02.phx.gbl...
> Maybe there's a patch for sql 2000, i fixed my win 2003 server and didn't
> encounter this issue with my SQL 2005.
>
> "jereviscious" <here@.there.com> wrote in message
> news:eEmN81vaHHA.4396@.TK2MSFTNGP06.phx.gbl...
>> Hi all.
>> I used tzedit to update the daylight savings time setting on my windows
>> 2000 server.. Now, when I run any of my reports, I get this error:
>> "An internal error occurred on the report server. See the error log for
>> more details. (rsInternalError) Get Online Help
>> Specified argument was out of the range of valid values. Parameter name:
>> date "
>> Does anyone have or heard of a solution?
>

Sunday, March 11, 2012

datetime format setting --> mm-dd-yyyy instead of dd-MM-yyyy in SQL Server 2005 / expre(is it

I’m getting a datetime format problem(mm-dd-yyyy for dd-MM-yyyy), when I install SQL Server 2005 Express. {The exception is: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.}

My windows Regional and Language options – English (United Kingdom), Sort date format is dd-MM-yyyy.

When converting the date time in Sql server is using the mm-dd-yyyy format. But I’m supplying the dd-mm-yyyy format date time.

I tried number of things none of them worked for me

1. Tried changing the default language and get the date time format

- exec sp_configure 'default language', 2057
reconfigure

- did not work

EXEC sp_defaultlanguage 'my user name', 'British'

- did not work

(Ref: http://www.cactushop.com/support/UKUS-date-format-issues-with-MS-SQLconversion-errors-or-blank-pages__592__.htm)

2. Tried a registry hack by opening regedit, and get the following 3 language keys and change it to decimal 2057:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90\Tools\ClientSetup\CurrentVersion]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90\Tools\Setup
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\Setup]

(Ref: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=62891)

- did not work

3. Every thing in the Regional and Language options to UK and British with the date time format input language keyboard and every think else I could think of, which could link to US English or US date format Did not work

4. even went into the extend of modifying the date format on a Windows machine for new users account by editing the HKEY_USERS registry key and creating a new user - Did not work

(Ref: http://www.windowsitpro.com/Article/ArticleID/39407/39407.html )

5. Uninstall and reinstall SQL server express several time and did the steps 1 – 4 where applicable – did not work….

If anyone has any idea of what I have to do to change the date time format in the SQL Server 2005 to use the dd-mm-yyyy format for dates....

Please help me or point me in the direction in which I have to look for an answer.

Thank you very much….

Some SQL Server datetime is language dependent, there is a guide below you can use to change it.

http://www.karaszi.com/SQLServer/info_datetime.asp|||

Thanks Caddre for the post…

Your suggestion confirm me that the datetime format I’m using is Numeric one, which is LANGUAGE dependent… therefore my question of is it with sql server login language ? I guess valid…

……………………………………………..

The problem happening in my ASP.net application; I’m connecting to the Sql Server using connection-string : <add name="conn" connectionString="Data Source=hostname;Initial Catalog=dbname;User Id=myname;Password=password;" providerName="System.Data.SqlClient"/>

Here the default language of this ‘myname’ user is British English

In some installation of Sql Server when I supply datetime in “yyyy-mm-dd HH:mmTongue Tieds.ms” format( E.g.: '2007-08-27 14:12:19.590') it work fine…

But in some other installation of Sql Server it throws the flowing exception

“The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.”

When I run the flowing command in both installations myname login, I’m getting the same result… as follows...

select SYSTEM_USER

- myname

select @.@.language

- British

I couldn’t find out what might be the problm between this two insallations?!!!!!

Any one have any suggestion? Please……………….

|||

You don't understand you need to change to language neutral format and you need to use overloads of the DateTime.ToString and other formatting for .NET DateTime in the application. I have covered that in the thread below.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1837895&SiteID=1

|||

[You don't understand you need to change to language neutral format and you need to use overloads of the DateTime.ToString and other formatting for .NET DateTime in the application]

I’m aware that in order to avoid language dependence or language dependent format problems; I have to change to language neutral format, and my datetime format is not a language neutral format….

But the application is a legacy asp.net application and it was working fine in many client places…

In the app - No Stored procedures used for insert, update or select – any one to change it …All the database select, insert, and update are inline-sql-statements in the application which are .net assemblies (dlls)…. and I can not change the application - because I’m not the developer of the application….

The only option available for me is to find out a way to change the date time format of the login user so that it won’t throw exception after 12th of each month…. That’s what I was trying to explain in my first post…

is there any solution for this?

I hope I’m clear on my description now…. sorry if I’m not clear on previous posts…

PS: - Please let me know if I’m not clear in this post ….or… if I should post this question to a different MSDN Forum…

Thank you…

|||

In the first place an application with inline SQL can get SQL injection and you have only two options either use the IsDate function or try using the British locale configuration in control panel. If that did not work you need to ALTER all the columns with Varchar as DateTime and make all the correction needed because client connection issue with bad code needs to be fixed.

http://msdn2.microsoft.com/en-us/library/aa176553(SQL.80).aspx

http://www.sql-server-helper.com/error-messages/msg-242.aspx

|||Hi all,
I am also having the SAME problem using MS ACCESS - supposedly an end user tool

I am a programmer of 30 years standing, so have some experience in building reliable inter application comms.

Now, I understand that the underlying technology is probably .NET

and that SQL is a bit vague on default date formats

HOWEVER

1) End users should not be exposed to this type of technologic problem
2) The MS Java driver gets it RIGHT FIRST TIME regardless of the regional and login settings in force
3) Similar problems have persisted for 15 or so years (Access, VB, Excel)

There is a work around - if your user will accept it - set Regional on the workstation to YYYY-MM-dd

MS - when can a more generic solution be delivered?
a) My customer is a MS solution provider
b) He does not want to migrate to YYY-MM-dd format since he DOES NOT KNOW WHAT THE IMPACT WILL BE ON HIS OTHER APPLICATIONS, and cannot afford the downtime in finding out
c) Should he change, there will be significant retraining of staff and losses due to incorrect data entry
d) All he sees is that he cant migrate from ACCESS / MDB to Access/SQL Server easily (both are MS product)
e) He has asked whether or not he should migrate to Java / Jasper / Mysql !

THE SOLUTION

MS - this should be in your court

1) You have 3 layers Access (or .net) , ODBC and SQL Svr
2) The first two are always on the client and thus can look at the same regional settings.
3) The .ODBC layer can interrogate the MS SQL server (or any other server for that matter) and establish what translations are required - or more simply establish its own convention e.g issue a SET DATE BRIT after establishing the connection. You could even invent a foolproof format of your own within proprietary extensions.
4) Workstation layer can look at regionalisation and ODBC setup options to determine connectivity
5) MS could even supply date format string options on the ODBC setup to define application and server preferred formats

RESULT

- ALL end user apps can now use SQL dates without mishap
- Bad applications that dont look at regionalisation can be catered for by configuring ODBC.
- User administrator can setup separate ODBC channesl and translation for all app variants

Everyone wins.|||

Thanks every one for the suggestions...

I have gone down the path of changing the windows Regional and Language options on the workstation to YYYY-MM-dd… (It worked….Big Smile….)

And the problem of my head temporarily…

datetime format setting --> mm-dd-yyyy instead of dd-MM-yyyy in SQL Server 2005 / expre(is it

I’m getting a datetime format problem(mm-dd-yyyy for dd-MM-yyyy), when I install SQL Server 2005 Express. {The exception is: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.}

My windows Regional and Language options – English (United Kingdom), Sort date format is dd-MM-yyyy.

When converting the date time in Sql server is using the mm-dd-yyyy format. But I’m supplying the dd-mm-yyyy format date time.

I tried number of things none of them worked for me

1. Tried changing the default language and get the date time format

- exec sp_configure 'default language', 2057
reconfigure

- did not work

EXEC sp_defaultlanguage 'my user name', 'British'

- did not work

(Ref: http://www.cactushop.com/support/UKUS-date-format-issues-with-MS-SQLconversion-errors-or-blank-pages__592__.htm)

2. Tried a registry hack by opening regedit, and get the following 3 language keys and change it to decimal 2057:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90\Tools\ClientSetup\CurrentVersion]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90\Tools\Setup
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\Setup]

(Ref: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=62891)

- did not work

3. Every thing in the Regional and Language options to UK and British with the date time format input language keyboard and every think else I could think of, which could link to US English or US date format Did not work

4. even went into the extend of modifying the date format on a Windows machine for new users account by editing the HKEY_USERS registry key and creating a new user - Did not work

(Ref: http://www.windowsitpro.com/Article/ArticleID/39407/39407.html )

5. Uninstall and reinstall SQL server express several time and did the steps 1 – 4 where applicable – did not work….

If anyone has any idea of what I have to do to change the date time format in the SQL Server 2005 to use the dd-mm-yyyy format for dates....

Please help me or point me in the direction in which I have to look for an answer.

Thank you very much….

Some SQL Server datetime is language dependent, there is a guide below you can use to change it.

http://www.karaszi.com/SQLServer/info_datetime.asp|||

Thanks Caddre for the post…

Your suggestion confirm me that the datetime format I’m using is Numeric one, which is LANGUAGE dependent… therefore my question of is it with sql server login language ? I guess valid…

……………………………………………..

The problem happening in my ASP.net application; I’m connecting to the Sql Server using connection-string : <add name="conn" connectionString="Data Source=hostname;Initial Catalog=dbname;User Id=myname;Password=password;" providerName="System.Data.SqlClient"/>

Here the default language of this ‘myname’ user is British English

In some installation of Sql Server when I supply datetime in “yyyy-mm-dd HH:mmTongue Tieds.ms” format( E.g.: '2007-08-27 14:12:19.590') it work fine…

But in some other installation of Sql Server it throws the flowing exception

“The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.”

When I run the flowing command in both installations myname login, I’m getting the same result… as follows...

select SYSTEM_USER

- myname

select @.@.language

- British

I couldn’t find out what might be the problm between this two insallations?!!!!!

Any one have any suggestion? Please……………….

|||

You don't understand you need to change to language neutral format and you need to use overloads of the DateTime.ToString and other formatting for .NET DateTime in the application. I have covered that in the thread below.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1837895&SiteID=1

|||

[You don't understand you need to change to language neutral format and you need to use overloads of the DateTime.ToString and other formatting for .NET DateTime in the application]

I’m aware that in order to avoid language dependence or language dependent format problems; I have to change to language neutral format, and my datetime format is not a language neutral format….

But the application is a legacy asp.net application and it was working fine in many client places…

In the app - No Stored procedures used for insert, update or select – any one to change it …All the database select, insert, and update are inline-sql-statements in the application which are .net assemblies (dlls)…. and I can not change the application - because I’m not the developer of the application….

The only option available for me is to find out a way to change the date time format of the login user so that it won’t throw exception after 12th of each month…. That’s what I was trying to explain in my first post…

is there any solution for this?

I hope I’m clear on my description now…. sorry if I’m not clear on previous posts…

PS: - Please let me know if I’m not clear in this post ….or… if I should post this question to a different MSDN Forum…

Thank you…

|||

In the first place an application with inline SQL can get SQL injection and you have only two options either use the IsDate function or try using the British locale configuration in control panel. If that did not work you need to ALTER all the columns with Varchar as DateTime and make all the correction needed because client connection issue with bad code needs to be fixed.

http://msdn2.microsoft.com/en-us/library/aa176553(SQL.80).aspx

http://www.sql-server-helper.com/error-messages/msg-242.aspx

|||Hi all,
I am also having the SAME problem using MS ACCESS - supposedly an end user tool

I am a programmer of 30 years standing, so have some experience in building reliable inter application comms.

Now, I understand that the underlying technology is probably .NET

and that SQL is a bit vague on default date formats

HOWEVER

1) End users should not be exposed to this type of technologic problem
2) The MS Java driver gets it RIGHT FIRST TIME regardless of the regional and login settings in force
3) Similar problems have persisted for 15 or so years (Access, VB, Excel)

There is a work around - if your user will accept it - set Regional on the workstation to YYYY-MM-dd

MS - when can a more generic solution be delivered?
a) My customer is a MS solution provider
b) He does not want to migrate to YYY-MM-dd format since he DOES NOT KNOW WHAT THE IMPACT WILL BE ON HIS OTHER APPLICATIONS, and cannot afford the downtime in finding out
c) Should he change, there will be significant retraining of staff and losses due to incorrect data entry
d) All he sees is that he cant migrate from ACCESS / MDB to Access/SQL Server easily (both are MS product)
e) He has asked whether or not he should migrate to Java / Jasper / Mysql !

THE SOLUTION

MS - this should be in your court

1) You have 3 layers Access (or .net) , ODBC and SQL Svr
2) The first two are always on the client and thus can look at the same regional settings.
3) The .ODBC layer can interrogate the MS SQL server (or any other server for that matter) and establish what translations are required - or more simply establish its own convention e.g issue a SET DATE BRIT after establishing the connection. You could even invent a foolproof format of your own within proprietary extensions.
4) Workstation layer can look at regionalisation and ODBC setup options to determine connectivity
5) MS could even supply date format string options on the ODBC setup to define application and server preferred formats

RESULT

- ALL end user apps can now use SQL dates without mishap
- Bad applications that dont look at regionalisation can be catered for by configuring ODBC.
- User administrator can setup separate ODBC channesl and translation for all app variants

Everyone wins.|||

Thanks every one for the suggestions...

I have gone down the path of changing the windows Regional and Language options on the workstation to YYYY-MM-dd… (It worked….Big Smile….)

And the problem of my head temporarily…

DateTime Format Problem: Setting to 16/Mar/2006 8:50:00 AM

my Current DateTime Format is 01/08/2006 9:15:00 AM

i want to set it to 01/Aug/2006 9:15:00 AM

what parameter will be pass in "SET DATEFORMAT"?

plz help and give me a chance of thanks.

You can't.

Shouldn't be trying to use SQL Server to do presentation formating anyhow.

|||

thanksMotley !

Idon't want to use SQL Server to do presentation formating . I want to fix this format for storage of DateTime data any time. I mean that any time any one tries to insert the DateTime data in my Database, that data should be store in my required format.

|||

Datetimes don't have a "format" (Ok, technically they do, but not a string format). They are stored as the number the days (and fractions there of) since the epoch. It does not store the months, years, hours, minutes, or seconds, let alone store them in any user-specified "format".

The fact that query analyzer/management studio/visual studio presents that value to you in a particular string format is for your benefit as a matter of presentation (AKA presentation formatting). SQL Server does have some capability in being able to convert to/from a datetime and varchar, but it's fairly rudimentary since you really shouldn't be doing presentation formatting in the database.

It's similiar to wanting to store the number of dollars of something into a table and asking how to get an integer field to accept the format "$5,000". It can't. That's not the databases job, that's for the presentation layer of your application to do (Convert $5,000 to 5000).

|||

again Thanks Lot Motley!

I have 2 different machines. Both having the SQL Server 2000 Professional Editon and OS = Windows XP.

One of the machine(M1) displays datetime like 16/Mar/2006 8:50:00 AM

while another machine(M2) has format 16/03/2006 8:50:00 AM

how to set same format for M2 as M1.

|||

As far as how the system displays it, it is probably a Window's setting. Have a look in Regional and Language Options from Control Panel - there is one for Long Formats, and one for Short. I don't think that how it is displayed is controlled by SQL Server, since as the other chap mentioned, SQL Server doesn't store dates in any kind of "format".

Otherwise, you can specify a format from SQL Server, but it will convert it from the datetime object to a varchar. You do this using the CONVERT function:

CONVERT

(varchar(12),p.date_effective,106)

The final parameter, 106 in this case, is the datetime format you want to use. A complete list of them is available at this site:

http://sqljunkies.com/Article/6676BEAE-1967-402D-9578-9A1C7FD826E5.scuk

Hope this helps!

|||As dominic mentioned, whatever application you are using to view the data is probably getting your preferred date format from the system settings of the client machine. You can set that in the control panel->Regional and Language Options->Customize->Date(Tab)->Short Date Format->dd-MMM-yyyy|||

yeah this was the solution.

Thanks Motley.

DateTime Format / Language Problem

Hi,
I'm having a problem with the datetime format in RS. I live in Canada but
want to use the "en-US" language setting because most of our clients using
the app are in the States. What I'm doing is formatting a start and end date
parameter from a .NET calendar control with "MM/DD/YYYY" before sending it
to the report for generation. If the user has "en-US" selected as their
language in IE, the report runs great. If they have "en-CA" selected as
their language, the month and day displays backwards, so Aug 25, 2004 shows
up as 24/8/2004 which crashes the report (obviously because there isn't a
24th month).
So I specified "en-US" in the report definition language property, I
included rs:ParameterLanguage=en-US in my URL call and I pasted the
following code into my global.asax file under BeginRequest to convert
threads to use "en-US":
Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
Nothing seems to be working...Am I missing something? Thanks,I just wanted to add to my post that the main toolbar is visible and
parameter toolbar is NOT visible.
Now if i hide the main toolbar, so both toolbars are hidden, the dates come
out properly and the report works regardless if the browser is set to
"en-US" or "en-CA".
Why does the visibility of the toolbars have anything to do with the way the
datetime format is displayed? We need to hide the parameter toolbar and show
the main toolbar for this particular application, but then the date gets
mixed up and the report won't work. Is this a bug?
"RS Developer" <idroppeddabomb@.hotmail.com> wrote in message
news:eXhvC$siEHA.2760@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I'm having a problem with the datetime format in RS. I live in Canada but
> want to use the "en-US" language setting because most of our clients using
> the app are in the States. What I'm doing is formatting a start and end
date
> parameter from a .NET calendar control with "MM/DD/YYYY" before sending it
> to the report for generation. If the user has "en-US" selected as their
> language in IE, the report runs great. If they have "en-CA" selected as
> their language, the month and day displays backwards, so Aug 25, 2004
shows
> up as 24/8/2004 which crashes the report (obviously because there isn't a
> 24th month).
> So I specified "en-US" in the report definition language property, I
> included rs:ParameterLanguage=en-US in my URL call and I pasted the
> following code into my global.asax file under BeginRequest to convert
> threads to use "en-US":
> Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
> Nothing seems to be working...Am I missing something? Thanks,
>|||Instead of using the .NET calendar control, have you considered modifying
the SQL statement and using either 102 is ANSI (yy/mm/dd), but 103 is
British/French (dd/mm/yy).
WHERE (CONVERT(varchar(10), time, 102) = CONVERT(varchar(10),
DATEADD(dd, - 2, { fn NOW() }), 102))
CONVERT(varchar(10), CONVERT(varchar(4), DATEPART(yy, time)) + '/' +
CONVERT(varchar(2), DATEPART(mm, time)) + '/' + CONVERT(varchar(2),
DATEPART(dd, time)), 102)
Rory
"RS Developer" <idroppeddabomb@.hotmail.com> wrote in message
news:eB8BNKtiEHA.2544@.TK2MSFTNGP10.phx.gbl...
> I just wanted to add to my post that the main toolbar is visible and
> parameter toolbar is NOT visible.
> Now if i hide the main toolbar, so both toolbars are hidden, the dates
come
> out properly and the report works regardless if the browser is set to
> "en-US" or "en-CA".
> Why does the visibility of the toolbars have anything to do with the way
the
> datetime format is displayed? We need to hide the parameter toolbar and
show
> the main toolbar for this particular application, but then the date gets
> mixed up and the report won't work. Is this a bug?
>
> "RS Developer" <idroppeddabomb@.hotmail.com> wrote in message
> news:eXhvC$siEHA.2760@.TK2MSFTNGP15.phx.gbl...
> > Hi,
> >
> > I'm having a problem with the datetime format in RS. I live in Canada
but
> > want to use the "en-US" language setting because most of our clients
using
> > the app are in the States. What I'm doing is formatting a start and end
> date
> > parameter from a .NET calendar control with "MM/DD/YYYY" before sending
it
> > to the report for generation. If the user has "en-US" selected as their
> > language in IE, the report runs great. If they have "en-CA" selected as
> > their language, the month and day displays backwards, so Aug 25, 2004
> shows
> > up as 24/8/2004 which crashes the report (obviously because there isn't
a
> > 24th month).
> >
> > So I specified "en-US" in the report definition language property, I
> > included rs:ParameterLanguage=en-US in my URL call and I pasted the
> > following code into my global.asax file under BeginRequest to convert
> > threads to use "en-US":
> >
> > Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
> >
> > Nothing seems to be working...Am I missing something? Thanks,
> >
> >
>|||Rory, thanks for your suggestion. Our client requested a graphical calendar
to pick dates so unfortunately I have to use the calendar control. The
problem for some reason is tied into the visibility of the toolbars, these
are the only combinations of visibility where the date gets formatted
properly (why the visibility of the toolbar is affecting date formatting is
beyond me):
Parameter = false, toolbar=false
Parameter = true, toolbar=true
Parameter = collapse , toolbar=true
However I need:
Parameter = false, toolbar=true
but then the date gets switched to dd/mm/yyyy and the report crashes...
"Rory McCaw" <mccawr@.rogers.com> wrote in message
news:ejYdThtiEHA.4020@.TK2MSFTNGP10.phx.gbl...
> Instead of using the .NET calendar control, have you considered modifying
> the SQL statement and using either 102 is ANSI (yy/mm/dd), but 103 is
> British/French (dd/mm/yy).
> WHERE (CONVERT(varchar(10), time, 102) = CONVERT(varchar(10),
> DATEADD(dd, - 2, { fn NOW() }), 102))
> CONVERT(varchar(10), CONVERT(varchar(4), DATEPART(yy, time)) + '/' +
> CONVERT(varchar(2), DATEPART(mm, time)) + '/' + CONVERT(varchar(2),
> DATEPART(dd, time)), 102)
> Rory
> "RS Developer" <idroppeddabomb@.hotmail.com> wrote in message
> news:eB8BNKtiEHA.2544@.TK2MSFTNGP10.phx.gbl...
> > I just wanted to add to my post that the main toolbar is visible and
> > parameter toolbar is NOT visible.
> >
> > Now if i hide the main toolbar, so both toolbars are hidden, the dates
> come
> > out properly and the report works regardless if the browser is set to
> > "en-US" or "en-CA".
> >
> > Why does the visibility of the toolbars have anything to do with the way
> the
> > datetime format is displayed? We need to hide the parameter toolbar and
> show
> > the main toolbar for this particular application, but then the date gets
> > mixed up and the report won't work. Is this a bug?
> >
> >
> > "RS Developer" <idroppeddabomb@.hotmail.com> wrote in message
> > news:eXhvC$siEHA.2760@.TK2MSFTNGP15.phx.gbl...
> > > Hi,
> > >
> > > I'm having a problem with the datetime format in RS. I live in Canada
> but
> > > want to use the "en-US" language setting because most of our clients
> using
> > > the app are in the States. What I'm doing is formatting a start and
end
> > date
> > > parameter from a .NET calendar control with "MM/DD/YYYY" before
sending
> it
> > > to the report for generation. If the user has "en-US" selected as
their
> > > language in IE, the report runs great. If they have "en-CA" selected
as
> > > their language, the month and day displays backwards, so Aug 25, 2004
> > shows
> > > up as 24/8/2004 which crashes the report (obviously because there
isn't
> a
> > > 24th month).
> > >
> > > So I specified "en-US" in the report definition language property, I
> > > included rs:ParameterLanguage=en-US in my URL call and I pasted the
> > > following code into my global.asax file under BeginRequest to convert
> > > threads to use "en-US":
> > >
> > > Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
> > >
> > > Nothing seems to be working...Am I missing something? Thanks,
> > >
> > >
> >
> >
>

Tuesday, February 14, 2012

date/time or date and time

I am setting up an SQL database and I will need to get differences in dates. For example I have a start date, start time, completion date and completion time and I want to get the difference between the start and completion.
Would it be better to have one field with both date and time in it, or better to have a date field and a time field?
Even though I have already started setting up the tables with seperate fields for date and time I am now leaning toward one field with date/time in it. (Only because that is the way I had to do it when setting up an Excel spreadsheet for a similar task)

When that is decided could someone please point me to a good resource for explaining to me the iConvertible method. I tried a simple asp.net page to insert a record into the database and got an error method telling me I had to use the iConvertible method. (I am programming in C#). I use a textbox on a webform to input the date and time information and the SQL database fields are set up as date/time. I looked at the visual studio documentation but that doesn't help me much. It doesn't show me the syntax required and how to "use" the method.
Thanksone field with datetime should be good...easier for maintenance too..and it will solve your puspose too...

** no idea abt iConvertible...sorry

hth|||You can use DataType as DateTime and to get the difference between the Dates you can use theDateTime.Subtract()