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

Date FM

Former Member
0 Likes
485

Hi,

I need the information based on date when I write the select statement like begda = '01.04.2006'. No data is displaying.

Please let me know how to get the information.

Thanks,

Pavan.

4 REPLIES 4
Read only

Former Member
0 Likes
447

Hi,

Check the format in which the date is stored.

If it is 20060401, then use select query

select * from

ztab

where begda = '20060401'.

Best regards,

Prashant

Read only

Former Member
0 Likes
447

Dates are stored in the database with format YYYYMMDD. Change the format of the variable you are evaluating in the where clause.

-Kiran

Read only

Former Member
0 Likes
447

Hello Pavan,

The begda is only 8 characters date fields.

SO in the select statement u should give the date in the sy-datum format ie)20060401.

Hope u got the answer.

Reward the point and close the thread.

Regards,

Vasanth

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
447

This is because all dates in the system are stored as YYYYMMDD. You need to convert to this format when trying to SELECT from db. If your date field is defined as type sy-datum, then the conversion is done for you.

You can do it like this.

where  begda = '20060104'.

Regards,

Rich Heilman