SEARCH YOUR SOLUTION HERE  

date format problem

hiiiiii......i have mysql in which i have taken data type "datetime" which takes in this format "yyyy-mm-dd hh:mm:ss" and c# datatime datatype gives mm/dd/yyyy now plsss tell me hurrily that what should i do....its really urgent.....i have used tostring("yyyy-mm-dd") but when i use it it looses its month portion...

Posted On: Tuesday 20th of November 2012 04:14:22 AM Total Views:  611
View Complete with Replies




Related Messages:

Problem with server date   (214 Views)
I have Oracle 8i installed on a Win2K Server. I have developed an ASP.Net Website using my XP PC connecting to the Oracle database on the Win2K Server and everything works fine. When I finally had the site ready, I copied it to the Win2K Server and tested it. Everything worked fine except for the dates. I get errors like "ORA-01843: not a valid month" in a code like this: strSQL = "select * from RP_EMPLEADO where to_char(EMPL_FECHA_NACIMIENTO, 'DD/MM')=to_char(to_date('"; strSQL += DateTime.Now.ToShortDateString(); strSQL += "', 'DD/MM/YYYY'), 'DD/MM') order by EMPL_APELLIDO_PATERNO"; cmdComando.CommandText = strSQL; dtrCumpleanos = cmdComando.ExecuteReader(); But I also get errors like "String was not recognized as a valid DateTime" in a code like this: Today = Convert.ToDateTime(Convert.ToString(i) + "/" + Today.Month.ToString() + "/" + Today.Year.ToString()); The latter makes me realize that the problem may have nothing to do with Oracle but with the .Net runtime or something like that. Other clues: - I have copied the site and tested it on other XP PCs and it has worked fine everytime. Some of the PCs had dd/mm/yyyy date format and some had mm/dd/yyyy date format. In all of them, when I show a Date, it displays like 25/08/2004 when I use code like this: strFecha = dtFecha.ToShortDateString(); - When I run the site in the Win2K Server, the dates display like 8/25/2004. It doesn't matter if I change the regional settings on the server. - the OS are in english. the PCs have the .Net 1.1 Framework installed. Some thoughts: - Maybe I need to install Visual Studio on the Win2k Server and recompile - Does the .Net runtime have another date settings, independent from the regional settings in the control panel PLEASE HELP!!!!, I thought I had the site ready but I need it to run on the Win2k Server!!!
need to convert a date in oracle   (262 Views)
I need to format a date from 12-apr-2004 into 12-apr. I do this in the select statement, can anyone provide a function that would make the conversion
validate backupset   (299 Views)
After taking a online back I am trying to validate the backup set , and am getting the following error. The backup set is still in the directory where it was orignally created. Is there something I am missing here... RMAN> run { 2> allocate channel c1 type disk; 3> validate backupset 2; 4> } RMAN-03022: compiling command: allocate RMAN-03023: executing command: allocate RMAN-08030: allocated channel: c1 RMAN-08500: channel c1: sid=9 devtype=DISK RMAN-03022: compiling command: validate RMAN-03026: error recovery releasing channel resources RMAN-08031: released channel: c1 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure during compilation of command RMAN-03013: command type: validate RMAN-06004: ORACLE error from recovery catalog database: RMAN-20215: backup set not found RMAN-06159: error while looking up backup set
Update using CASE statement - can't see it.   (278 Views)
Havin' a bad day......... What's wrong with this UPDATE PHILTEST SET TYPE = CASE DATE1 WHEN '05-NOV-03' THEN 'CR' WHEN '01-DEC-03' THEN 'TN' WHEN '01-JAN-04' THEN 'RV' END CASE; END CASE * ERROR at line 6: ORA-00933: SQL command not properly ended
Update Statement   (128 Views)
If I have a update statement in a PL/SQL program and I want to capture the amount of rows updated, how would I do that without a count
unable to retrieve date format   (227 Views)
Hi I tried to insert a date format into oracle database from a perl script and select the date from the database. However, I encountered ora-01821 data format not recongized format! If i select without the hours&mins I will be able to retrieve it. why is this so insert into table values (to_date(sysdate,'dd-mm-yyyy hh24:mi:ss')); select to_char(datetime,'dd-mm-yyyy hh24:mi:ss') from table;
Tool for converting REDO to Insert/Update/Delete statements   (245 Views)
Hi , Is there any Tool Provided by Oracle Corp. itself to convert REDO to Insert/Update/Delete statements. Or is there such kind of a tool from any other Organization to fullfill the above mentioned purpose The basic need behind this is to avoid applying the archieve logs & apply these converted SQL statements rather. Can somebody comeup with a suggestion plz
table blocked with "... for update NOWAIT"   (247 Views)
, I have a table which is blocked because of experiments with select... for update nowait any ideas on how to delock the table
Sysdate And To_date   (152 Views)
HOW CAN SELECT RECORDS BETWEEN THE SYSTEM DATE AND THE SYSTEM DATE - 7 DAYS. ITS BASICALLY THE EQUIVALENT OF DATEADD(). I CAN GET THE CURRENT DATE BY USING TO_DATE(SYSDATE, 'DD-MM-YYYY') BUT I CANT GET SYSDATE - 7 DAYS. THANKS....
sql_redo sql_undo same for Update Operations   (211 Views)
Hi , I was extracting all records with UPDATE operation from v$logminer_contents .. but i see sql_redo and sql_undo operation same in oracle Dabatase version 8.1.7.4.0.0 However i see insert and delete operations correctly . or am i missing anything important ... also could anybody suggest , if there is a faster way to fetech data from v$logminer_contents . as it is taking very long time from starting the logmining operation till query is fetched . i am looking something like specifying parallel options etc ... appreciate your help regarding this ...
Sqlloader , validate data before load   (171 Views)
everybody, some application generates ASCII-Files like monday.dat, tuesday.dat etc. I would like to load data form this tables into a table in Oracle using following validation rules: If a record already exists in the table then skip it. If a record has been updated on Monday evening - update it in the table. If a record doesn't exist - insert it. Hope you understand what I mean
SQL Query question (count dates for each month)   (335 Views)
, Hope you can help me with the following, i have the following view availble: DD/MM/YYYY ENTITY | StartDate | EndDate | CodeA | CodeB | Revenue | Currency AZERT | 01/01/2011 | 02/01/2011 | SU | BOLD | 100 | EUR AZERT | 28/01/2011 | 02/02/2011 | SU | BOLD | 500 | EUR Can someone help with a query to pull the data so that I get the following summed ENTITY | YYYY.MM | CodeA | CodeB | DAYS | TIMES | Revenue | Currency AZERT | 2011.01 | SU | BOD | 5 | 2 | 500 | EUR AZERT | 2011.02 | SU | BOD | 1 | 0 | 100 | EUR Where YYYY.MM is created depending on the difference between Sdate and EDate. And DAYS is the variance between the start and end day in the right month And TIMES is the number of times that the StartDate occurs in that month Revenue splitted depening how many days there are.
Simple Update statement   (119 Views)
I am using the following simple update statement UPDATE TABLE1 SET FIELD1 = TRANSLATE(FIELD1,'0123456789','1234567890') WHERE LENGTH(TRIM(FIELD1))=5; and the table has 25 Million rows and its throwing following error ERROR at line 1: ORA-01555: snapshot too old: rollback segment number with name "" too small ORA-06512: at line 11 I don't have permission to increase rollback segment. Any suggesion please ...
Select MAX(order_date) ??   (263 Views)
Hi , I'm NOT a developer, so rarely get stuck into code. This sounds easy but I'm having trouble. Here goes... I need to select the Person ID (PID), order_date and order_amount from transaction table. Each PID can have many transaction rows, but I need to return the row with the latest transaction date for each PID. So, I'm looking at select pid,order_date,order_amount from transaction group by pid,max(order_date) ORA-00934: group function is not allowed here To further clarify, here's a sample of the transaction table PID ORDER_DATE ORDER_AMOUNT 12 12-JUL-02 12.99 12 13-JUL-02 45.99 12 14-JUL-02 2.99 13 22-MAY-02 33.99 13 14-JUN-02 22.99 I need to return 12 14-JUL-02 2.99 13 14-JUN-02 22.99 I'm probably being a bit thick here, but I'll admit to being less than experienced with SQL
select distinct count on different dates   (319 Views)
I want to select count of distinct requests for different statuses on different days like today, yesterday and day-before-yesterday from sample table, please guide me in this regard. Currently using following query where i get daily count. columns: req_Status, req_id,sent_date select req_status, count(distinct(req_id)) as REQ_TODAY, MIN(to_char(SENT_DATE,'DD-MON-YY - HH:MI:SS')) as Min_sent_date, MAX(to_char(SENT_DATE,'DD-MON-YY - HH:MI:SS')) as Max_sent_date,'1-NEW Command' Meaning_of_Status from sample where sent_date like sysdate and req_status=1 group by req_status union select req_status, count(distinct(req_id)) as REQ_TODAY, MIN(to_char(SENT_DATE,'DD-MON-YY - HH:MI:SS')) as Min_sent_date, MAX(to_char(SENT_DATE,'DD-MON-YY - HH:MI:SS')) as Max_sent_date,'2-old Command' Meaning_of_Status from sample where sent_date like sysdate and req_status=2 group by req_status union . . and so on... column req_status has values in range from 1 to 12 output: REQ_STATUS REQ_TODAY MIN_SENT_DATE MAX_SENT_DATE MEANING_OF_STAT ------------- ------------ --------------------- --------------------- ------------------- 1 3 25-JUL-12 - 06:47:20 25-JUL-12 - 07:28:24 1-NEW Command 2 3 25-JUL-12 - 06:47:20 25-JUL-12 - 08:07:10 2-old Command 3 3 25-JUL-12 - 06:47:20 25-JUL-12 - 08:07:29 3-wrong Command . . so on for 12 REQ_STATUSes In this output I need two more columns that will depict count of requests for different statuses for last two days as follows : REQ_STATUS | REQ_CNT_DB4YEST | REQ_CNT_YEST | REQ_TODAY | MIN_SENT_DATE | MAX_SENT_DATE | MEANING_OF_STAT
release date for oracle7.3   (227 Views)
Can some one please tell me the release date for Oracle7.3 on any platform - NT/Solaris...Unix
Recover the rollback datefiles   (183 Views)
I am in the process of practice to recover the rollback datafiles, I followed these steps from the backup and recovery book but it's wrong. The name of the book is Oracle 8i backup & recovery by RAMA VELPURI. any way , here are the summary: 1. I created a table 2. set transaction use rollback segment rb1 3. insert one record into this table 4. shutdown abort 5. del rbs1orcl.ora datafile 6. copy the rbs1orcl.ora from the backup 7. uncomment out the ROLLBACK_SEGMENTS in the init.ora 8. startup mount; 9. alter database datafile 'c:\oradata\rbs1.dbf' offline; 10. alter database open and I got the errors: * ORA-00604: error occured at recursive SQL level 2 ORA-00376: file 2 cannot be read at this time ORA-01110: data file 2: 'c:\ORADATA\RBS1.DBF' please advise b/c the book is not right. According to the book, I should be able to open the database. Please help
pulling data from current date back to 1st of the month   (154 Views)
hi, i want to automate a query that pulls data from the current date back through the first of the month. i want it to run every day. something like: select colname from table where createdate >= {first_of_the_month} and createdate
'IN operator' for dates in sql   (300 Views)
hi, Do anyone know how to use IN operator for date values I have 1 query as below, which I can put any date value to retrieve the data but when I execute I getORA-01843: not a valid month. select* fromtable wheretime_stampIN('02/28/2012','07/22/2012','09/29/2012') Sample result: Num Qty Time_stamp 1 2 02/28/2012 2 2 07/22/2012 3 2 09/29/2012 Any idea how to solve this Instead of using IN operator, is that others way
Please Correct Errors in my Update query   (229 Views)
Hi Friends, I'm confusing here,please correct my errors and plz tell me how to write queries in this context...