Jump to content

SQL Query help


jefferson1

Recommended Posts

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

 

 

Link to comment
Share on other sites

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) 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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()

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...