Jump to content

SQL Query help


Recommended Posts

Posted

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

 

 

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

Posted
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.

Posted
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

Posted
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 

 

Posted
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

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

Posted
16 minutes ago, Fish said:

Monna interview lo adigaaru yee question 

 

Congratulations bro 

Posted
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

Posted
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

 

Posted
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

Posted
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

Posted

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 

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

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...