jefferson1 Posted February 27, 2020 Report Posted February 27, 2020 table lo oka column undi created - column name created column lo values 2020-02-14 16:38:48.340 ani store ayi untai so i need to write a query which will ignore hours and minutes Quote
pistaUncle Posted February 27, 2020 Report Posted February 27, 2020 select to_char(created, 'YYYY-MM-DD') from table Quote
supportamaravathi Posted February 27, 2020 Report Posted February 27, 2020 5 minutes ago, jefferson1 said: table lo oka column undi created - column name created column lo values 2020-02-14 16:38:48.340 ani store ayi untai so i need to write a query which will ignore hours and minutes Postgres ite just date(created) Quote
jefferson1 Posted February 27, 2020 Author Report Posted February 27, 2020 1 minute ago, pistaUncle said: select to_char(created, 'YYYY-MM-DD') from table na query ila undi select * from tablename where abc = '12345' so where condition lo inko parameter add cheyali, which is created and it should get values from a date ignoring seconds. Quote
Ellen Posted February 27, 2020 Report Posted February 27, 2020 4 minutes ago, jefferson1 said: table lo oka column undi created - column name created column lo values 2020-02-14 16:38:48.340 ani store ayi untai so i need to write a query which will ignore hours and minutes Just convert it to date data type, it will ignore the time part Quote
Fish Posted February 27, 2020 Report Posted February 27, 2020 10 minutes ago, jefferson1 said: table lo oka column undi created - column name created column lo values 2020-02-14 16:38:48.340 ani store ayi untai so i need to write a query which will ignore hours and minutes Monna interview lo adigaaru yee question Quote
pistaUncle Posted February 27, 2020 Report Posted February 27, 2020 5 minutes ago, jefferson1 said: na query ila undi select * from tablename where abc = '12345' so where condition lo inko parameter add cheyali, which is created and it should get values from a date ignoring seconds. select * from table where abc = '12345' and to_char(created,'YYYY-MM-DD') = '2020-02-26' please note depending upon your db the syntax may change , this will work for oracle Quote
Ellen Posted February 27, 2020 Report Posted February 27, 2020 10 minutes ago, jefferson1 said: na query ila undi select * from tablename where abc = '12345' so where condition lo inko parameter add cheyali, which is created and it should get values from a date ignoring seconds. TRUNC() Quote
AbhiiRama Posted February 27, 2020 Report Posted February 27, 2020 16 minutes ago, Fish said: Monna interview lo adigaaru yee question Congratulations bro Quote
jefferson1 Posted February 27, 2020 Author Report Posted February 27, 2020 13 minutes ago, pistaUncle said: select * from table where abc = '12345' and to_char(created,'YYYY-MM-DD') = '2020-02-26' please note depending upon your db the syntax may change , this will work for oracle nadi mssql, i will try this tomorrow thanks bro Quote
jajjanaka_jandri Posted February 27, 2020 Report Posted February 27, 2020 47 minutes ago, jefferson1 said: table lo oka column undi created - column name created column lo values 2020-02-14 16:38:48.340 ani store ayi untai so i need to write a query which will ignore hours and minutes two ways lo cheyyochu 1. use the date function to get date out of the column 2. substring use chesi first 10 chars teesko Quote
karthikn Posted February 27, 2020 Report Posted February 27, 2020 49 minutes ago, jefferson1 said: table lo oka column undi created - column name created column lo values 2020-02-14 16:38:48.340 ani store ayi untai so i need to write a query which will ignore hours and minutes google search lo first result kada vayya.. did you even try google "ignore time in datetime sql" first stackoverflow link lo many options hai Quote
jefferson1 Posted February 27, 2020 Author Report Posted February 27, 2020 Just now, karthikn said: google search lo first result kada vayya.. did you even try google "ignore time in datetime sql" first stackoverflow link lo many options hai nenu sql expert kadu...so i have to run a query to get some results ...one time anthe Quote
Srin Posted February 27, 2020 Report Posted February 27, 2020 select cast(column_name as date) if column value is 2020-02-14 16:38:48.340 pi query just date value vastundi result : 2020-02-14 hope this will work out for you Quote
Ellen Posted February 27, 2020 Report Posted February 27, 2020 35 minutes ago, jefferson1 said: nadi mssql, i will try this tomorrow thanks bro ms sql aite aah tochar place lo cast use cheyandi, it removes the time part example select cast(datetime as date) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.