cast in sql

Posted on 2005-05-08
Last Modified: 2013-12-09
i want to make a request sql will return distinct date in a table.
The date are the attribut 'dat_achat' in my table 'facture'
the type is timestanp and where i 'm execute the request :
select distinct f.dat_achet from facture
all the date are selectionned because the time are different
I would like execute a request that like :
select cast(f.dat_achat to date) from facture f
but it don't work
tks for help
Question by:tlpacheco
    1 Comment
    LVL 2

    Accepted Solution

    did you use the distinct keyword with the cast to date?

    this works for me

    select distinct cast(f.dat_achat as Date) from facture f

    cheers, Terry

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Creating and Managing Databases with phpMyAdmin in cPanel.
    Read about achieving the basic levels of HRIS security in the workplace.
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now