How to return a different format of datetime type in sql?

hi ,
i think this is a dumb question for all of you guys but since i am new here, hope you can help me. here is my problem i have a column in my table that has a namae Date and a type of datetime, what i want is to display the date in grid(UI) using a different
format, cause right now this is the value returning.
02.11.2011 10:23:02
what i want is to return the value without the time.
please advise thanks!

What grid you're talking about? What kind of application is that? I'm quite sure you should be able to format date fields the way you want - your question then has nothing to do with SQL Server.
Of course, you can return dates as character (as Tom suggested) in the predefined format, but I'd rather investigate formatting options of the grid control.
For every expert, there is an equal and opposite expert. - Becker's Law
My blog

Similar Messages

  • How to  write file excel format xlsx/xlsb to pl/sql?

    Dear supporter,
    I built the xml report output excel file. However, the reported data and about 30 columns, line 200000 write and loading file slow, large file size
    How can write data directly to the format xlsb / xlsx from pl / sql. quickly and efficiently.
    Please, help me!
    Tks,
    Mr.T

    Check this thread.
    Re: 5. How do I read or write an Excel file?

  • How to Get Default Value of a Data Type in SQL Query.

    Hi all,
    I am creating a procedure which will take input the table name and Column Name.
    In the Output i would like to have the data type and default value of that data type which will be used by a another procedure to blank the selected column in the database.
    I tried with SET NULL on the column but as the database is of navision the table have property set to NOT NULL.
    Here is what i have done till now.
    Create Procedure Get_Column_type
    @parm_table_name nvarchar(200),
    @parm_column_name nvarchar(20),
    @parm_result nvarchar(20)OUTPUT
    AS
    BEGIN 
    select @parm_result =
    DATA_TYPE from INFORMATION_SCHEMA.COLUMNS IC
    where TABLE_NAME = '[' + @parm_table_name +']' and COLUMN_NAME = '[' + @parm_column_name + ']'
    END
    GO
    Now instead on write a case statement for so many data types in SQL, i was thinking is it possible someway that above procedure also returns the default value which i can set in another procedure.
    Let me know if its possible or not? Thanks in advance.

    Do you looking for something like this?
    create table t10 ( c int default 1)
    SELECT so.name AS table_name, 
              sc.name AS column_name, 
              sm.text AS default_value
         FROM sys.sysobjects so
         JOIN sys.syscolumns sc ON sc.id = so.id
    LEFT JOIN sys.syscomments SM ON sm.id = sc.cdefault
        WHERE so.xtype = 'U' 
          AND SO.name = 't10'
     ORDER BY so.[name], sc.colid
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Queries broken when URL started returning a different format

    I had a great results with Power Query, using the From Web GUI to create very useful queries.  But very recently, all queries from a particular website broke on refresh.  When trying to recreate them, I find there are no longer any formatted HTML
    tables being displayed in the Navigator Preview; instead, the preview shows only an entry labeled document.  Clicking on the document returns a preview in tabular format (Caption=Document, Source=Service, ClassName=null, Id=null, Data=Table).  Drilling
    down on the table returns another level with another table (Kind=Element, Name=HTML, Children=Table, Text=null).  I've drilled down farther and see more HTML tables but I have not hit upon the table data.  Viewing the web page source, I see the table
    with the data; I just cannot correlate its location to the multiple nested levels of tables in the document returned by the URL.  The web page source looks pretty standard:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">.
    So apparently the website I was pulling data from has changed how they deliver web content.  Can anyone tell me whether I am now SOL with Power Query's current capabilities?  Or whether there is a relative easy way to navigate such a document returned
    in the From Web Preview to get to the table data?  Thanks!

    Ehren's awesome suggestion to use Text.FromBinary worked great.  The only problem is that the text of the web page shows me that the trouble may be related to cookies.  Below is the relevant HTML. 
    When I access this URL directly via IE version 11, I do not get this error; instead, I see my target table (that I used to be able to load successfully using Power Query From Web).
    Are there settings in Power Query (or in Excel 2013) where I have any control over accepting cookies?
    Thanks!
    Relevant HTML:
    <TR VALIGN=top>
    <TD CLASS="default"><BR></TD>
    <td><br>
    <SPAN class="defaultXLgbl">
    Your browser appears to have a problem accepting cookies.
    </span>
    <P>
    You will not be able to continue until you correct this problem.
    <P>
    Cookie problems can often be fixed by following these steps:
    <UL>
    <LI>Disable any 3rd party Privacy or Ad-blocking software you may have installed.
    <LI>Check that your computer's clock is set correctly.
    <LI>For Internet Explorer users:
    <UL>
    <LI>Check the Privacy setting in the "Internet Options" menu. Make sure it is set at Medium.
    <LI>Delete your Temporary Internet Files, also via the "Internet Options" menu.
    </UL>
    <LI>If you have more than one web browser installed on your computer, try using another browser and see
    if the problem persists.
    </UL>

  • How to edit with different formats of clips

    Hi, I am sorry to as this question, I should know the answer but just ain't sure. I am making my reel and I have a bunch of stuff that is dv dvcpro NTSC and that is what the sequence setting is set to. 29.97 compressor is DV DVCPRO-NTSC. However, I have some footage that is DVCPRO HD 720P60.
    When its in the timeline the preview sure makes it look awkward, quality loss. What is the right thing to do here. Also, all my NTSC footage is 4:3, but what does my FC sequence register it as a NTSCDV (3:2) and not NTSC 4:3. Although it looks fine, I just want to understand my timeline settings. Thanks and hope to hear from someone.
    Also, can anyone point me in the right direction to learn how to deal with editing footage with different frame rates. For ex, some 29.97 footage, 23.98/24 Thanks
    Nat

    HI Swarup,
    thanx for the response.
    i did the same thing...i imported 2 different versions into xi and used in mapping.and interface is working fine.
    what i am concerned is : will there be any problem in future while transporting to different environments?
    and why it is showing 'segment version' in attribute in Trace in sxmb_moni....
    any inputs will be help full....
    Thanx in advance.
    regards.

  • How can I change the format of numbers in Oracle SQL Developer 1.0 ?

    The value 1.4345 from a table is represented in Oracle SQL Developer 1.0 like 1.5
    How can I change this to see all the digits ?
    Thanks

    Where did you see that, in the SQL Worksheet or viewing the data Connections ->.. tables ->.. tree?
    What datatype, precision and column name you have?
    I use version 1.0.0.15.57 and seems to be working allright.
    - Babu Rangasamy

  • How to return a single datetime from multiple rows of MAX(value) in DAX

    Hi
    I have a Results table with ResultTime, Balance, Equity which is updated with a new row every 5 minutes. I've used SUMX to find opening and closing balances and it has worked so far.
    Res_OpeningBalance:=SUMX(TOPN(1,Results,Results[ResultTime],1),[Balance])
    Res_ClosingBalance:=SUMX(TOPN(1,Results,Results[ResultTime],0),[Balance])
    But when I tried it with dates, the whole thing fell apart.
    Res_MaxBalance_Date:=SUMX(TOPN(1,Results,Results[Balance],0),[ResultTime])
    Since the highest Balance is likely to be represented through many rows due to it lasting more than 5 minutes, ResultTime (which is unique to each row) is summed up and returns messed up dates well into the future. How to return only one date (first or last
    datetime) from the rows where Balance is at max?
    I tried a TOPN of TOPN, but Excel was not amused.
    =SUMX(TOPN(1,Results,Results[Balance],0),TOPN(1,Results,Results[ResultTime],0))
    TIA!
    Re
    Dennis

    I still don't understand RANKX, but I figured it out anyway. I get the correct data by using:
    Res_MaxBalance:=MAX(Results[Balance])
    Res_MaxBalanceDate:=CALCULATE(MAX(Results[ResultTime]),FILTER(Results, Results[Balance]=MAX(Results[Balance])))
    Res_MinBalance:=MIN(Results[Balance])
    Res_MinBalanceDate:=CALCULATE(MAX(Results[ResultTime]),FILTER(Results, Results[Balance]=MIN(Results[Balance])))
    Res_MaxEquity:=MAX(Results[Equity])
    Res_MaxEquityDate:=CALCULATE(MAX(Results[ResultTime]),FILTER(Results, Results[Equity]=MAX(Results[Equity])))
    Res_MinEquity:=MIN(Results[Equity])
    Res_MinEquityDate:=CALCULATE(MAX(Results[ResultTime]),FILTER(Results, Results[Equity]=MIN(Results[Equity])))
    Re
    D

  • How can I keep my text format after pasting a text with a different format?

    No matter when and where I start to write some text (whether it is a SImpleText, E-Mails, or anyother application's doc), if I have to cut and paste a text from a different source that is formatted differently than my original text (ie. the one I am already using ), once I have pasted the differently formatted text in my doc, the typeset changes while it continues to type with the same formatt used in the text I just pasted.
    How can I continue typing with the same text formatt used before pasting the new text, after pasting the new text, without having to change size, font style etc. Is there a short cut?
    What I have been doing to avoid this problem is: I usually type my entire text content (whether it is an E-Mail, or other doc) then, once I am done typing, I paste the text that was cut from a differently formatted document, so that my text remains with the same formatt in its integrity, while the pasted text stands out differently, but it is a bit complex doing that , because I not only have to remember to paste the other text when I am done typing (I run the risk of forgetting to paste the text I need to insert--which has happened already) or I keep struggling with my formatt change after the pasting of the new text, so my document text starts looking like the same text as the one which was just pasted.
    Thanks for your time reading this!

    KerrBr wrote:
    How can I continue typing with the same text formatt used before pasting the new text, after pasting the new text, without having to change size, font style etc. Is there a short cut?
    (1) First, let's make sure we're talking about the same thing. By "SImpleText, E-Mails" you mean TextEdit and Mail, right?
    (2) Some apps (TextEdit, Mail) use the text engine provided by Mac OS X. By and large, these apps will behave in a similar manner. Others (eg, MS Word) use their own text engine, and their behaviour can be quite different. For such an app you need to consult its manual.
    (3) In TextEdit, if you want the pasted text to adopt the current style, then use kurt188's tip.
    (4) However, if you may want the pasted text to retain its own attributes, while you continue to type in the previous style. I don't know of any shortcut or command that will achieve this. However, you can try to work around it.
    (4.1) TextEdit has the Copy Style (⌘⌥C) and Paste Style (⌘⌥V) commands. If you haven't yet used it, ⌘⌥V will insert the default style. So type, paste, ⌘⌥V, then continue typing. If you have used, it will insert whatever style was copied. You can, type, ⌘V, click somewhere before the pasted text, ⌘⌥C, click after the pasted text, ⌘⌥V, and continue typing.
    (4.2) Alternatively, type your text. Then type one more character, eg, "x". Then ←, ⌘V, ⇧→, and start typing. The new text should adopt "x"'s format. (This should work in Mail, too. I don't know, because IMHO e-mail should always be plain text.)

  • When I listen to music on Apple TV 2 my pictures from iPhoto come in, but always the same album (which I nevr asked for), always in random order and always in a different format. How can I control what is going on and choose the album myself.

    When I listen to music on Apple TV 2 my pictures from iPhoto come in aafter about ten minutes, but always the same album (which I never asked for), always in random order and always in a different format. How can I choose a different album myself and control the order and format?

    Thank you Winston for a helpful response and for reminding me of something which I found nearly a year ago and then lost (in my mind) because I did not use it. I am grateful for a correct answer but it still only achieves part of what I wanted.
    I can now choose my photos, decide how long they stay on screen and choose one of a variety of presentations. Two things I still can't do.
    One is to get it to play the photos in the chronological order in which I have carefully set them in an album; it still tends to be random and repetitive. The other is that I cannot get any of them them to saty on screen for more than about 20 seconds. I guess this is all due to the way Apple TV is constructed.
    But still thanks, nevertheless.
    Alec

  • How do I make a DVD copy of a file? And does the file have to be converted from mpeg or mp4 or.MOV to a different format before it can be copied and is readable by DVD? Thanks.

    How do I make a DVD copy of a file? And does the file have to be converted from mpeg or mp4 or.MOV to a different format before it can be copied and is readable by DVD? Thanks.

    Great hearing for you all! I thought I was all alone this past weekend. I did learn a lot this weekend. I really like the InDesign product.(half-the-battle) But to be helped by the prestigious “Sandee Cohen” was an honor indeed.”  I ordered the InDesign CC today.  Peter, I appreciate all the feedback on Lynda too. They are loaded with lots of good videos. Derek too honed in on one of the most important aspects!  Since I have been working with Word for most of the first portion of the book this will be a big help. I looked at the comments big help ! Thanks a ton ALL!  Have a wonder day or evening whenever you read this reply.

  • How can I sort photos within an event? When I follow the Help instructions, I can sort manually in Photo format, but when I return to Event format, the original order is restored.

    How can I sort photos within an event? When I follow the Help instructions, I can sort manually in Photo format, but when I return to Event format, the original order is restored.

    Events are organisation for those who can't really be bothered. They are automatic - based entirely on Date and Time the camera records the photos as taken.
    You can move photos between Events, you can Merge Events, you can Rename them and sort them in various ways except one: You cannot manually sort in an Event as Events are all automated.
    If you want to manually sort in an Event then you've outgrown Events as an organising tool. Now it's time to look at albums (Where you can manually sort) which are much more flexible than Events as an organising tool.

  • How to save an image in different format

    i want to save an image in different format (as .jpg ,.gif, .tiff, .png, .bmp) using save dialog box , where format should come in drop box menu "Save as type" in save dialoge box.what to do.???????plz any one suggest me .........

    alok_raj wrote:
    i want to save an image in different format (as .jpg ,.gif, .tiff, .png, .bmp) using save dialog box , where format should come in drop box menu "Save as type" in save dialoge box.what to do.???????plz any one suggest me .........1) Spell words properly. That word is 'please'.
    2) Fix your sticky keyboard for the '?' and '.' keys. Only one of those characters is generally needed to denote a question or the end of a sentence. Two or more often denotes a dweeb.
    I might come back to your question later, assuming I can actually bare looking at that mess long enough to figure out what you want.

  • How to set the format of DATETIME without second

    Default format of DATETIME is "yyyy/MM/dd HH:mm:ss". But I need to remove the "ss", so I write the coding as below:
    oracle.cabo.ui.validate.Formatter formatter =
    new oracle.apps.fnd.framework.webui.OADateValidater("yyyy/MM/dd HH:mm", "yyyy/MM/dd HH:mm:ss");
    webBean.findChildRecursive("SagyouStart").setAttributeValue(ON_SUBMIT_VALIDATER_ATTR, formatter);
    However, when I click the submit button, a error message about date format error will be shown in the page.
    If I set attribute of the submit button, which "serverUnvalidated" is TRUE, the page can be fine.
    Still, have other ways? Thank.

    1. Are you planning to insert the data into the table or just display purpose?
    2. if you want to insert into the table, then you modify thru
    OANLSServices Class. You can get instantiate thru transaction.getOANLSServices. This class has many methods to chage from String to DateTime or DateTime to JavaDate .
    Hope this helps.
    Thanks
    RK

  • Stored procedure: how to return multline table

    Environment: SQL Server 2008 R2, Windows
    Tools: MSMS 2008 R2
    Code:
    CREATE PROCEDURE [dbo].[Cleanup]
    (@id CHAR(12)
    ,@Date DATETIME
    ,@ID int OUT
    ,@Ln_ID CHAR(10) OUT
    ,@qcdate DATETIME OUT
    ,@P4 VARCHAR(8000)OUT
    ,@P9 VARCHAR(8000) OUT
    ,@P11 VARCHAR(8000) OUT
    ) WITH ENCRYPTION
    AS
    BEGIN
    Update Table_mocha
    SET P4=Replace(PE4,RTRIM(Cast(Q_ID as varchar(10))), '')
    where id=@id and order_dt=@Date
    Update Table_mocha
    SET P4 = NullIf(P4,'')
    where id=@id and order_dt=@Date
    Update Table_mocha
    SET P4=LTRIM(RTRIM(P4))
    where id=@id and order_dt=@Date
    SELECT @id=id, ln_id=@ln_id,@p4=p4, @p9=P9,@p11=P11
    where id=@id and order_dt=@Date
    Problem: having three updates would cause the database to lock. How would I pass input paramaters for those three updates in SP. How would I update multiple tables, how to avoid database lock, how to return multi-statment table - value (display
    table contains multiple records)

    I prefer to use different stored procedures to do different things.
    CREATE PROCEDURE [dbo].usp_updatedata
    (@id CHAR(12)
    ,@Date DATETIME
    AS
    BEGIN
    Update Table_mocha
    SET P4=LTRIM(RTRIM(Nullif(Replace(PE4,RTRIM(Cast(Q_ID as varchar(10))), ''),'')))
    where id=@id and order_dt=@Date
    End
    CREATE PROCEDURE [dbo].usp_getData
    (@id CHAR(12)
    ,@Date DATETIME
    AS
    BEGIN
    SET NOCOUNT ON;
    SELECT id, ln_id,p4, P9,P11
    where id=@id and order_dt=@Date
    End

  • Header and Footer in different format

    Hi ,
    I am using a single RDF file to generate a report in 4
    different formats by giving the destype during rumtime. I am
    facing a problem regarding the Header and Footer . My requirment
    is to show the Header and Footer once in HTML (Header on first
    page and Footer on last page) and in case of RTF andPDF on each
    page. The header and footer contains formula columns in which I
    query from database.
    Can anyone help me how to do this using one single RDF file.
    Thanks,
    Alka

    Hi,
    We tried using trigger as suggested by you for displaying the
    header and footer once in HTML. Now we are able to show the
    Header on first page in HTML but we also getting blank rows
    between records wherever we are hidding the Header .
    Please suggest how can we remove these blank rows.
    regards,
    Alka.
    hello,
    you could achieve this by using the format trigger of the
    header/footer-objects, where you could check the desformat and
    the page-number in order to dermine if they should be printed or
    not.
    regards,
    the oracle reports team --pw                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

Maybe you are looking for

  • Can not set data range for a numerical control

    I want to set the maximum of data range to 5000, but it always went back to default value of 127. WHy I can not change the data range? Thanka for explanations. Message Edited by Dejun on 11-14-2007 11:47 PM Attachments: datarange.jpg ‏74 KB

  • I want to use time machine to backup two 4 TB drives, one USB and the other thunder bolt  to 2 4TB USB drives

    I have a 2012 iMac running Mavericks, booting off of a external 4TB thunderbolt drive and using a separate 4TB USB drive for my pictures. I want to back up each of the drives to two USB 4TB  drives with Time Machine. I cannot seem to figure out how t

  • Unexpected delay when dynamically called VI closes

    LV10.0 / WXP A VI is called dynamically by Run VI Method (Wait Until Done = FALSE, Auto Dispose Ref = TRUE). Queues are used to exchange data with the main VI. When this VI closes ("stop" message from the main VI), LabVIEW hangs for about 25 seconds

  • Taglib missing

    Hi, we have some application throwing the following exception: application b2b Runtime error in compiling of the JSP file </usr/sap/CDJ/JC01/j2ee/cluster/server0/apps/sap.com/crm~b2b/servlet_jsp/b2b/root/b2b/login/forward_start.jsp> ! The error is: c

  • Engineering, Services and Knowledge International Conference AW

    THE BODY OF THE THREAD/POST: Our apologies if you receive multiple copies of this Call for Papers ====================================================================== Management Track within WiCOM International Conference on Engineering, Services a