473,568 Members | 2,762 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to view date using sql

Hi there
I'm new in DB2, currently i'm into java development
The problem that i'm facing is that when i use JSP page to save, the
date is correct when i pass(from JSP page) to database, but when i
checked inside the database the date stored is different than what i
passed or saved into the datbase. Can anyone have idea on this ?
If possible, how can i see the server time using DB2 sql command ?
i have tried now(),getDate,. . and so on...
Can anyone assist me on this problem
Thanks

Jan 20 '06 #1
3 1803
"josh3006" <jo******@insyn chro-dot-net.no-spam.invalid> wrote in message
news:43******** **************@ authen.yellow.r eadfreenews.net ...
Hi there
I'm new in DB2, currently i'm into java development
The problem that i'm facing is that when i use JSP page to save, the
date is correct when i pass(from JSP page) to database, but when i
checked inside the database the date stored is different than what i
passed or saved into the datbase. Can anyone have idea on this ?
If possible, how can i see the server time using DB2 sql command ?
i have tried now(),getDate,. . and so on...
Can anyone assist me on this problem
Thanks


Date columns are always stored internally within DB2 the exact same way,
regardless how it is sent to DB2 for storage. The internal format is YYYMMDD
in packed decimal without sign bits, using a total of 4 bytes (2 numbers per
byte).

The retrieval display format differs depending on the language and country
code of the database server and/or the client. The display format always has
separators such as dashes, slashes, periods, etc depending on which
language/country code. The total length of display format is 10 bytes
character.

You can change the display format for the date from the default of your DB2
installation by using the CHAR command as described in the SQL Reference Vol
1. There are several defined formats to choose from such as ISO, USA, etc.
Jan 20 '06 #2
Hi all, sorry on the doubt
I have resolve it
The DB2 saving with
MM/DD/YYYY format

all this while i was sending as DD/MM/YYYY

Jan 20 '06 #3
You can use another formats too.(The point is delimiter character.)
DD.MM.YYYY or YYYY-MM-DD

Jan 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6593
by: Mark | last post by:
Hi, I'm trying to write a view that returns a historical view of records as of a certain date. The records come from a live and historical table and I need to return the records as they were in the live table on various dates. The SQL to do this is no problem but it requires a date value in a where clause in an inner select (the sql is...
2
2315
by: Hennie de Nooijer | last post by:
Because of an error in google or underlying site i can reply on my own issue. Therefore i copied the former entered message in this message. -------------------------------------REPY---------------------------------- Hi Maybe i wasn't clear. I want to dynamically check whether what the lowest date and the highest date is in the calendar table....
6
3023
by: _link98 | last post by:
Problem: getting SQL0181N for queries on nicknames to remote Union-All-View. Can't see what I'm doing wrong yet, maybe someone has seen this before. Environment: UDB ESE 8.1 + FIXPAK 9A, on Solaris 8.1, with 64-bit instances. I have a NICKNAME called REMOTE_DW.T_MYTABLE which points to a "union-all-view". Several other nicknames exist...
2
1802
by: David C | last post by:
I am looking for some kind of calendar view control that I can show hyperlinks to records in day cells. This is to be used for showing scheduled events and people can see events in a calendar view and click on links to view details of events. Is there one out there? Thanks.
6
3562
by: Woody Splawn | last post by:
I am using SQL Server 2000 as a back-end to a VS.net Client/Server app. In a certain report I use a view as part of the query spec. For the view, at present, I am querying for all the records in the table. But I am wondering if there is a way, at runtime, to pass values to the View (like start date and end date) so that I don't have to...
20
1990
by: raptor | last post by:
hi, I want to make the following thing : select-based updatable VIEW, which have two more virtual-fields. One of them is concatenation of others and the second is calculated on the fly. Can I do this and if yes how? can u give some example? Here is the test bed : table1) id, date, field1, field2
4
2073
by: JayCallas | last post by:
I have a SQL 2000 table containing 2 million rows of Trade data. Here are some of the columns: INT IDENTITY(1,1) -- PK, non-clustered DATETIME -- clustered index DATETIME -- non-clustered index VARCHAR(10) VARCHAR(10) INT etc..
9
2180
by: harborboy76 | last post by:
Hi, I have a problem with one of my view. Basically, I need to create a view to sum the amount in Table A grouped by the EMPLOYEE_ID. But I also need the ability to limit the date range. What I need to do is creating a view with the ability to limit the date range want the result sets to be broken down by employee_id (not dates).
4
2265
by: Dia | last post by:
Hi there, I struggle to get this going i would like to insert data into 2 tmp tables in a view. If i run the code on it's own it works perfectly until i want to create a view it complains about the INSERT this is my code
12
4693
by: brwalias | last post by:
Hi, using .net 2 sql server 2005 Here is my situation: I'm passing a variable in the url from a selection on Page A and need to display the results on the Results page be based on that variable in the url. I would like that variable to trigger a stored and
0
7693
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7604
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8117
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7660
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
932
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.