Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1221
  • Last Modified:

cast in sql

hlo
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
Thierry
0
tlpacheco
Asked:
tlpacheco
1 Solution
 
Trekker72Commented:
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
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now