Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Database Query

Former Member
0 Likes
592

Hi All,

In my database table 1 field of

Format (contract end date): DDMMYYYY HHMMSS

While writing the Query in the where clause i can't pass the value for the HHMMSS (Hour minute second) , i can only pass the MMYYYY (month year). So in this case How to write a query to get the data based on my date.

Sunil

5 REPLIES 5
Read only

Former Member
0 Likes
562

Hi!

Try to address the time data this way:

datum_time+9(6)

Regards

Tamá

Read only

0 Likes
562

Hope u didn't understand my Q.

Clarify Below:

SELECT HEADER date_4 from crmd_order_index into table i_guid where stat_released = 'X'

AND date_2 = l_date.

D/B Field: date_2--> Format---> DDMMYYYY HHMMSS

Prog. Field: l_date-> Format---> DDMMYYYY

Sunil

Read only

Former Member
0 Likes
562

Hi Sunil,

Concatenate date field and time field into variable of type that you specify in ur table and pass the variable in ur where clause.

Yogesh N

Read only

Former Member
0 Likes
562

Hi

Then in such caes u write query like this.


select * from <table>
   into  ...
 where timefiled like '%YYYYMM%'.

...

endselect.

Regards,

Sunil Kumar Mutyala

Read only

Former Member
0 Likes
562

Hi,

Write this way-

Data: w_date type sy-datum,
         w_pass(10) type c.

w_date = date+2(6).

concatenate '%' w_date '%' into w_pass.

Select * from ztable into itab where date like w_pass.

Regards,

Sujit