Access Date/time to SQL to only show Date

Discussion in 'Software' started by Whothehell, Jul 27, 2006.

  1. Whothehell


    Jul 27, 2006
    Likes Received:
    I currently have a Microsoft Access database that has a column for date, and its data type is date/time , format short date. I'm building a website to show all the data from the database onto a webpage, using SQL. When I load the webpage I see the date column showing both the date and the time.

    <asp:BoundField DataFormatString="{0:d}" DataField="prsnnl_hire_date" SortExpression="prsnnl_hire_date" HeaderText="Hire Date"></asp:BoundField>

    That is the code above, and I thought the DataFomatString="{0:d}" would solve my problem but it hasn't. Anyone have any ideas for it just to show the date??

    P.S. I'm a noob
    Whothehell, Jul 27, 2006
    1. Advertisements

  2. Whothehell


    Jul 25, 2006
    Likes Received:
    Hello you can say to me as updating of a database in SQL from a form in ASP.Net? Thank you very much for your help.
    Donald reyes
    Donald, Jul 27, 2006
    1. Advertisements

  3. Whothehell


    Jul 27, 2006
    Likes Received:
    All right to add some clarification.
    I'm using Visual Web Developer 2005 Express Edition
    and using gridview.

    <script runat="server">

    Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)

    End Sub


    <form id="Form1" runat=server>
    <asp:gridview id="GridView1" runat="server" cellpadding="4" datasourceid="Test"
    forecolor="#333333" gridlines="None" AutoGenerateColumns="False" DataKeyNames="prsnnl_id" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
    <FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True"></FooterStyle>
    <asp:BoundField ReadOnly="True" DataField="prsnnl_id" InsertVisible="False" SortExpression="prsnnl_id" HeaderText="prsnnl_id"></asp:BoundField>
    <asp:BoundField DataField="prsnnl_lst_nm" SortExpression="prsnnl_lst_nm" HeaderText="prsnnl_lst_nm"></asp:BoundField>
    <asp:BoundField DataField="prsnnl_first_nm" SortExpression="prsnnl_first_nm" HeaderText="prsnnl_first_nm"></asp:BoundField>
    <asp:BoundField DataFormatString="{0:d}" DataField="prsnnl_hire_date" SortExpression="prsnnl_hire_date" HeaderText="prsnnl_hire_date"></asp:BoundField>
    <asp:BoundField DataFormatString="{0:d}" DataField="prsnnl_terminate_date" SortExpression="prsnnl_terminate_date" HeaderText="prsnnl_terminate_date"></asp:BoundField>
    <asp:CheckBoxField DataField="prsnnl_security_folder_ind" SortExpression="prsnnl_security_folder_ind" HeaderText="prsnnl_security_folder_ind"></asp:CheckBoxField>
    <asp:BoundField DataField="job_level_nm" SortExpression="job_level_nm" HeaderText="job_level_nm"></asp:BoundField>
    <asp:BoundField DataField="org_grp_nm" SortExpression="org_grp_nm" HeaderText="org_grp_nm"></asp:BoundField>
    <asp:BoundField DataField="co_nm" SortExpression="co_nm" HeaderText="co_nm"></asp:BoundField>
    <asp:BoundField DataField="security_officer_lst_nm" SortExpression="security_officer_lst_nm" HeaderText="security_officer_lst_nm"></asp:BoundField>

    <RowStyle BackColor="#F7F6F3" ForeColor="#333333"></RowStyle>

    <EditRowStyle BackColor="#999999"></EditRowStyle>

    <SelectedRowStyle BackColor="#E2DED6" ForeColor="#333333" Font-Bold="True"></SelectedRowStyle>

    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center"></PagerStyle>

    <HeaderStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True"></HeaderStyle>

    <AlternatingRowStyle BackColor="White" ForeColor="#284775"></AlternatingRowStyle>
    <asp:accessdatasource id="Test" runat="server" datafile="~/Data/Databasne_name.mdb"
    selectcommand="SELECT * FROM [PERSONNEL]"></asp:accessdatasource>

    THat's the source code, and I have nothing written in the vb portion.
    Whothehell, Jul 27, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.