PC Review


Reply
Thread Tools Rate Thread

Where can I set the output format of a database date field ?

 
 
David Martin
Guest
Posts: n/a
 
      15th Mar 2004
I know this is silly but I can't remember where I did this before -
I have a W2K server running IIS and SQL server & IIS with FP 2002
extensions.

The same web page exists on the server and also on my workstation.
The same name for the ODBC data source is used by both machines.

My problem is that on the server the date is output with leading zeroes on
days and months under 10 - on my work station they are not. (A script
processes the output - so I would like it consistant).

I think i set something on the server to get it that way but I can't find
where I did it now,

David.


 
Reply With Quote
 
 
 
 
Vijay R Gangolli [MSFT]
Guest
Posts: n/a
 
      15th Mar 2004
Hi David,

Where does the data have leading zeros?? - the database, the html page????

Anyway it might be the Control Panel->Regional and Language
Options->Customize on the Server.

Regards,
Vijay

Disclaimer: This posting is provided "as is" with no warranties and confers
no rights

--------------------
| From: "David Martin" <(E-Mail Removed)>
| Subject: Where can I set the output format of a database date field ?
| Date: Mon, 15 Mar 2004 15:02:38 +0100
|
| I know this is silly but I can't remember where I did this before -
| I have a W2K server running IIS and SQL server & IIS with FP 2002
| extensions.
|
| The same web page exists on the server and also on my workstation.
| The same name for the ODBC data source is used by both machines.
|
| My problem is that on the server the date is output with leading zeroes on
| days and months under 10 - on my work station they are not. (A script
| processes the output - so I would like it consistant).
|
| I think i set something on the server to get it that way but I can't find
| where I did it now,
|
| David.
|
|
|

 
Reply With Quote
 
David Martin
Guest
Posts: n/a
 
      15th Mar 2004
The leading zeroes are on the web page when presented from the server (but
not the workstaion)- your suggestion was my first thought - because if it
was I would need to recode the script to cope with both situations.

I did wonder if it was in the ODBS settings - but I don't think so.

p.s. both pages server & workstaton are being viewed from the w/s.
also other clients seem to work fine when the page comes from the
server.

David.

"Vijay R Gangolli [MSFT]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi David,
>
> Where does the data have leading zeros?? - the database, the html page????
>
> Anyway it might be the Control Panel->Regional and Language
> Options->Customize on the Server.
>
> Regards,
> Vijay
>
> Disclaimer: This posting is provided "as is" with no warranties and

confers
> no rights
>
> --------------------
> | From: "David Martin" <(E-Mail Removed)>
> | Subject: Where can I set the output format of a database date field ?
> | Date: Mon, 15 Mar 2004 15:02:38 +0100
> |
> | I know this is silly but I can't remember where I did this before -
> | I have a W2K server running IIS and SQL server & IIS with FP 2002
> | extensions.
> |
> | The same web page exists on the server and also on my workstation.
> | The same name for the ODBC data source is used by both machines.
> |
> | My problem is that on the server the date is output with leading zeroes

on
> | days and months under 10 - on my work station they are not. (A script
> | processes the output - so I would like it consistant).
> |
> | I think i set something on the server to get it that way but I can't

find
> | where I did it now,
> |
> | David.
> |
> |
> |
>



 
Reply With Quote
 
Vijay R Gangolli [MSFT]
Guest
Posts: n/a
 
      16th Mar 2004
Hi David,

This date that you are displaying, is this the System Date or the SQL date?
i.e. are you using <%=Now()%> or Select GetDate() with formatting?

The first one I believe uses the regional setting, where as the second one
would use the ODBC setting if returned as a date field (not an expert on
SQL thought).

So you could actually compare the Control Panel->Regional and Language ->
Options->Customize of the Server and the Workstation and also
compare the "Use regional setting when outputting currency, numbers, dates
and times." in the odbcad32 configuration for the DSN.

Regards,
Vijay

Disclaimer: This posting is provided "as is" with no warranties and confers
no rights

--------------------
| From: "David Martin" <(E-Mail Removed)>
| References: <(E-Mail Removed)>
<(E-Mail Removed)>
| Subject: Re: Where can I set the output format of a database date field ?
| Date: Mon, 15 Mar 2004 21:07:53 +0100
|
| The leading zeroes are on the web page when presented from the server (but
| not the workstaion)- your suggestion was my first thought - because if it
| was I would need to recode the script to cope with both situations.
|
| I did wonder if it was in the ODBS settings - but I don't think so.
|
| p.s. both pages server & workstaton are being viewed from the w/s.
| also other clients seem to work fine when the page comes from the
| server.
|
| David.
|
| "Vijay R Gangolli [MSFT]" <(E-Mail Removed)> wrote in message
| news:(E-Mail Removed)...
| > Hi David,
| >
| > Where does the data have leading zeros?? - the database, the html
page????
| >
| > Anyway it might be the Control Panel->Regional and Language
| > Options->Customize on the Server.
| >
| > Regards,
| > Vijay
| >
| > Disclaimer: This posting is provided "as is" with no warranties and
| confers
| > no rights
| >
| > --------------------
| > | From: "David Martin" <(E-Mail Removed)>
| > | Subject: Where can I set the output format of a database date field ?
| > | Date: Mon, 15 Mar 2004 15:02:38 +0100
| > |
| > | I know this is silly but I can't remember where I did this before -
| > | I have a W2K server running IIS and SQL server & IIS with FP 2002
| > | extensions.
| > |
| > | The same web page exists on the server and also on my workstation.
| > | The same name for the ODBC data source is used by both machines.
| > |
| > | My problem is that on the server the date is output with leading
zeroes
| on
| > | days and months under 10 - on my work station they are not. (A script
| > | processes the output - so I would like it consistant).
| > |
| > | I think i set something on the server to get it that way but I can't
| find
| > | where I did it now,
| > |
| > | David.
| > |
| > |
| > |
| >
|
|
|

 
Reply With Quote
 
David Martin
Guest
Posts: n/a
 
      16th Mar 2004
The dates are in two database fields of type DateTime.
The regional settings are the same on both machines (U.K.) and the preview
for the short date format previews 09/03/2004 DD/MM/YYYY.

The ODBC settings were slightly different so I made them the same (except
the server has the host set to local).

The select used is the FrontPage default.with no added complexity
fp_sQry="SELECT * FROM RATESView"

So the table is the same table.
the DataSource are as close as possible.
The regional settings are the same.
Both results are being viewed from the same client.
The asp page is a copy of the server page.
also both use the same version of W2K & FP Server Extensions 2002.

I have tried creating two new pages without my processing code and I notice
the my client displays the date with no leading 0 and is displaying
MM/DD/YYY.
Ues I am sure the regional setting is (cut & Paste) DD/MM/yyyy

David.

"Vijay R Gangolli [MSFT]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi David,
>
> This date that you are displaying, is this the System Date or the SQL

date?
> i.e. are you using <%=Now()%> or Select GetDate() with formatting?
>
> The first one I believe uses the regional setting, where as the second one
> would use the ODBC setting if returned as a date field (not an expert on
> SQL thought).
>
> So you could actually compare the Control Panel->Regional and Language ->
> Options->Customize of the Server and the Workstation and also
> compare the "Use regional setting when outputting currency, numbers, dates
> and times." in the odbcad32 configuration for the DSN.
>
> Regards,
> Vijay
>
> Disclaimer: This posting is provided "as is" with no warranties and

confers
> no rights
>
> --------------------
> | From: "David Martin" <(E-Mail Removed)>
> | References: <(E-Mail Removed)>
> <(E-Mail Removed)>
> | Subject: Re: Where can I set the output format of a database date field

?
> | Date: Mon, 15 Mar 2004 21:07:53 +0100
> |
> | The leading zeroes are on the web page when presented from the server

(but
> | not the workstaion)- your suggestion was my first thought - because if

it
> | was I would need to recode the script to cope with both situations.
> |
> | I did wonder if it was in the ODBS settings - but I don't think so.
> |
> | p.s. both pages server & workstaton are being viewed from the w/s.
> | also other clients seem to work fine when the page comes from the
> | server.
> |
> | David.
> |
> | "Vijay R Gangolli [MSFT]" <(E-Mail Removed)> wrote in

message
> | news:(E-Mail Removed)...
> | > Hi David,
> | >
> | > Where does the data have leading zeros?? - the database, the html
> page????
> | >
> | > Anyway it might be the Control Panel->Regional and Language
> | > Options->Customize on the Server.
> | >
> | > Regards,
> | > Vijay
> | >
> | > Disclaimer: This posting is provided "as is" with no warranties and
> | confers
> | > no rights
> | >
> | > --------------------
> | > | From: "David Martin" <(E-Mail Removed)>
> | > | Subject: Where can I set the output format of a database date field

?
> | > | Date: Mon, 15 Mar 2004 15:02:38 +0100
> | > |
> | > | I know this is silly but I can't remember where I did this before -
> | > | I have a W2K server running IIS and SQL server & IIS with FP 2002
> | > | extensions.
> | > |
> | > | The same web page exists on the server and also on my workstation.
> | > | The same name for the ODBC data source is used by both machines.
> | > |
> | > | My problem is that on the server the date is output with leading
> zeroes
> | on
> | > | days and months under 10 - on my work station they are not. (A

script
> | > | processes the output - so I would like it consistant).
> | > |
> | > | I think i set something on the server to get it that way but I can't
> | find
> | > | where I did it now,
> | > |
> | > | David.
> | > |
> | > |
> | > |
> | >
> |
> |
> |
>



 
Reply With Quote
 
Vijay R Gangolli [MSFT]
Guest
Posts: n/a
 
      16th Mar 2004
Hi David,

Hmm.. Well there is a possible solution that I used to use long time back,
if you are ready to change the code. The select query can be changed to
return the date in the format you require, but ensure that you convert it
to varchar before returning in the select statement. Hence when it is
passed across different layers (odbc, asp), it remains a string and is not
modified by any of them. Its a WYSIWYG

Let me know if it helps.

Regards,
Vijay

Disclaimer: This posting is provided "as is" with no warranties and confers
no rights

--------------------
| From: "David Martin" <(E-Mail Removed)>
| References: <(E-Mail Removed)>
<(E-Mail Removed)>
<(E-Mail Removed)>
<(E-Mail Removed)>
| Subject: Re: Where can I set the output format of a database date field ?
| Date: Tue, 16 Mar 2004 14:03:48 +0100

| The dates are in two database fields of type DateTime.
| The regional settings are the same on both machines (U.K.) and the preview
| for the short date format previews 09/03/2004 DD/MM/YYYY.
|
| The ODBC settings were slightly different so I made them the same (except
| the server has the host set to local).
|
| The select used is the FrontPage default.with no added complexity
| fp_sQry="SELECT * FROM RATESView"
|
| So the table is the same table.
| the DataSource are as close as possible.
| The regional settings are the same.
| Both results are being viewed from the same client.
| The asp page is a copy of the server page.
| also both use the same version of W2K & FP Server Extensions 2002.
|
| I have tried creating two new pages without my processing code and I
notice
| the my client displays the date with no leading 0 and is displaying
| MM/DD/YYY.
| Ues I am sure the regional setting is (cut & Paste) DD/MM/yyyy
|
| David.
|
| "Vijay R Gangolli [MSFT]" <(E-Mail Removed)> wrote in message
| news:(E-Mail Removed)...
| > Hi David,
| >
| > This date that you are displaying, is this the System Date or the SQL
| date?
| > i.e. are you using <%=Now()%> or Select GetDate() with formatting?
| >
| > The first one I believe uses the regional setting, where as the second
one
| > would use the ODBC setting if returned as a date field (not an expert on
| > SQL thought).
| >
| > So you could actually compare the Control Panel->Regional and Language
->
| > Options->Customize of the Server and the Workstation and also
| > compare the "Use regional setting when outputting currency, numbers,
dates
| > and times." in the odbcad32 configuration for the DSN.
| >
| > Regards,
| > Vijay
| >
| > Disclaimer: This posting is provided "as is" with no warranties and
| confers
| > no rights
| >
| > --------------------
| > | From: "David Martin" <(E-Mail Removed)>
| > | References: <(E-Mail Removed)>
| > <(E-Mail Removed)>
| > | Subject: Re: Where can I set the output format of a database date
field
| ?
| > | Date: Mon, 15 Mar 2004 21:07:53 +0100
| > |
| > | The leading zeroes are on the web page when presented from the server
| (but
| > | not the workstaion)- your suggestion was my first thought - because if
| it
| > | was I would need to recode the script to cope with both situations.
| > |
| > | I did wonder if it was in the ODBS settings - but I don't think so.
| > |
| > | p.s. both pages server & workstaton are being viewed from the w/s.
| > | also other clients seem to work fine when the page comes from
the
| > | server.
| > |
| > | David.
| > |
| > | "Vijay R Gangolli [MSFT]" <(E-Mail Removed)> wrote in
| message
| > | news:(E-Mail Removed)...
| > | > Hi David,
| > | >
| > | > Where does the data have leading zeros?? - the database, the html
| > page????
| > | >
| > | > Anyway it might be the Control Panel->Regional and Language
| > | > Options->Customize on the Server.
| > | >
| > | > Regards,
| > | > Vijay
| > | >
| > | > Disclaimer: This posting is provided "as is" with no warranties and
| > | confers
| > | > no rights
| > | >
| > | > --------------------
| > | > | From: "David Martin" <(E-Mail Removed)>
| > | > | Subject: Where can I set the output format of a database date
field
| ?
| > | > | Date: Mon, 15 Mar 2004 15:02:38 +0100
| > | > |
| > | > | I know this is silly but I can't remember where I did this before
-
| > | > | I have a W2K server running IIS and SQL server & IIS with FP 2002
| > | > | extensions.
| > | > |
| > | > | The same web page exists on the server and also on my workstation.
| > | > | The same name for the ODBC data source is used by both machines.
| > | > |
| > | > | My problem is that on the server the date is output with leading
| > zeroes
| > | on
| > | > | days and months under 10 - on my work station they are not. (A
| script
| > | > | processes the output - so I would like it consistant).
| > | > |
| > | > | I think i set something on the server to get it that way but I
can't
| > | find
| > | > | where I did it now,
| > | > |
| > | > | David.
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

 
Reply With Quote
 
David Martin
Guest
Posts: n/a
 
      17th Mar 2004
Many thanks for your help Vijay - found where the problem is !

you were on the right track - all of a sudden it came to me - my
international settings are not releverent - it is the IIS anonomous user who
pulls the data from SQL server. - on the server the default local was set to
U.K. and on the Client to USA.

Thanks again for your help.

David.

"Vijay R Gangolli [MSFT]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi David,
>
> Hmm.. Well there is a possible solution that I used to use long time back,
> if you are ready to change the code. The select query can be changed to
> return the date in the format you require, but ensure that you convert it
> to varchar before returning in the select statement. Hence when it is
> passed across different layers (odbc, asp), it remains a string and is not
> modified by any of them. Its a WYSIWYG
>
> Let me know if it helps.
>
> Regards,
> Vijay
>
> Disclaimer: This posting is provided "as is" with no warranties and

confers
> no rights
>
> --------------------
> | From: "David Martin" <(E-Mail Removed)>
> | References: <(E-Mail Removed)>
> <(E-Mail Removed)>
> <(E-Mail Removed)>
> <(E-Mail Removed)>
> | Subject: Re: Where can I set the output format of a database date field

?
> | Date: Tue, 16 Mar 2004 14:03:48 +0100
>
> | The dates are in two database fields of type DateTime.
> | The regional settings are the same on both machines (U.K.) and the

preview
> | for the short date format previews 09/03/2004 DD/MM/YYYY.
> |
> | The ODBC settings were slightly different so I made them the same

(except
> | the server has the host set to local).
> |
> | The select used is the FrontPage default.with no added complexity
> | fp_sQry="SELECT * FROM RATESView"
> |
> | So the table is the same table.
> | the DataSource are as close as possible.
> | The regional settings are the same.
> | Both results are being viewed from the same client.
> | The asp page is a copy of the server page.
> | also both use the same version of W2K & FP Server Extensions 2002.
> |
> | I have tried creating two new pages without my processing code and I
> notice
> | the my client displays the date with no leading 0 and is displaying
> | MM/DD/YYY.
> | Ues I am sure the regional setting is (cut & Paste) DD/MM/yyyy
> |
> | David.
> |
> | "Vijay R Gangolli [MSFT]" <(E-Mail Removed)> wrote in

message
> | news:(E-Mail Removed)...
> | > Hi David,
> | >
> | > This date that you are displaying, is this the System Date or the SQL
> | date?
> | > i.e. are you using <%=Now()%> or Select GetDate() with formatting?
> | >
> | > The first one I believe uses the regional setting, where as the second
> one
> | > would use the ODBC setting if returned as a date field (not an expert

on
> | > SQL thought).
> | >
> | > So you could actually compare the Control Panel->Regional and Language
> ->
> | > Options->Customize of the Server and the Workstation and also
> | > compare the "Use regional setting when outputting currency, numbers,
> dates
> | > and times." in the odbcad32 configuration for the DSN.
> | >
> | > Regards,
> | > Vijay
> | >
> | > Disclaimer: This posting is provided "as is" with no warranties and
> | confers
> | > no rights
> | >
> | > --------------------
> | > | From: "David Martin" <(E-Mail Removed)>
> | > | References: <(E-Mail Removed)>
> | > <(E-Mail Removed)>
> | > | Subject: Re: Where can I set the output format of a database date
> field
> | ?
> | > | Date: Mon, 15 Mar 2004 21:07:53 +0100
> | > |
> | > | The leading zeroes are on the web page when presented from the

server
> | (but
> | > | not the workstaion)- your suggestion was my first thought - because

if
> | it
> | > | was I would need to recode the script to cope with both situations.
> | > |
> | > | I did wonder if it was in the ODBS settings - but I don't think so.
> | > |
> | > | p.s. both pages server & workstaton are being viewed from the w/s.
> | > | also other clients seem to work fine when the page comes from
> the
> | > | server.
> | > |
> | > | David.
> | > |
> | > | "Vijay R Gangolli [MSFT]" <(E-Mail Removed)> wrote in
> | message
> | > | news:(E-Mail Removed)...
> | > | > Hi David,
> | > | >
> | > | > Where does the data have leading zeros?? - the database, the html
> | > page????
> | > | >
> | > | > Anyway it might be the Control Panel->Regional and Language
> | > | > Options->Customize on the Server.
> | > | >
> | > | > Regards,
> | > | > Vijay
> | > | >
> | > | > Disclaimer: This posting is provided "as is" with no warranties

and
> | > | confers
> | > | > no rights
> | > | >
> | > | > --------------------
> | > | > | From: "David Martin" <(E-Mail Removed)>
> | > | > | Subject: Where can I set the output format of a database date
> field
> | ?
> | > | > | Date: Mon, 15 Mar 2004 15:02:38 +0100
> | > | > |
> | > | > | I know this is silly but I can't remember where I did this

before
> -
> | > | > | I have a W2K server running IIS and SQL server & IIS with FP

2002
> | > | > | extensions.
> | > | > |
> | > | > | The same web page exists on the server and also on my

workstation.
> | > | > | The same name for the ODBC data source is used by both machines.
> | > | > |
> | > | > | My problem is that on the server the date is output with leading
> | > zeroes
> | > | on
> | > | > | days and months under 10 - on my work station they are not. (A
> | script
> | > | > | processes the output - so I would like it consistant).
> | > | > |
> | > | > | I think i set something on the server to get it that way but I
> can't
> | > | find
> | > | > | where I did it now,
> | > | > |
> | > | > | David.
> | > | > |
> | > | > |
> | > | > |
> | > | >
> | > |
> | > |
> | > |
> | >
> |
> |
> |
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Forcing Date format as output? S Davis Microsoft Access 1 22nd Nov 2006 09:54 PM
Keeping date format of a field inserted from an excel database =?Utf-8?B?VGltIENvc3NpbnM=?= Microsoft Excel Worksheet Functions 1 21st May 2005 12:49 AM
Export Outlook date field as date/time format to Access database =?Utf-8?B?QmVja3k=?= Microsoft Outlook Discussion 0 2nd Dec 2004 02:49 PM
DATABASE FIELD and Date format =?Utf-8?B?R0lH?= Microsoft Word Document Management 9 27th Nov 2003 09:31 AM
Help using a database to output different names in a field Benjamin Chait Microsoft Word Document Management 3 29th Sep 2003 04:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:01 AM.