time problem

TikusJalang
Member Posts: 12
hi everyone I'm newbie here,
I wanna ask the problem about the field time
I have table named shift, and field named Begin Time and End Time, and both of it has data type time...
at the regional option in control panel, I fill the format for time is "HH:mm:ss"
but when I fill the table with Begin Time "22:00:00" and End Time "3:00:00" and doing some code to check the record I found the bug I think...
I create new variable data type time, I named it "varTime" and I fill this variable with "1:00:00"
when I doing some coding like this :
IF (varTime > rec."Begin Time") AND (varTime < rec."End Time") THEN
Message('Success!');
but the message never pop-up and if I think the logic is right because when I fill the table with time less than "00:00:00" it worked !!!!!!
but if I fill with time more than "23:59:00" it didn't work...
can you fix this problem pls?
Thnks b4...
I wanna ask the problem about the field time
I have table named shift, and field named Begin Time and End Time, and both of it has data type time...
at the regional option in control panel, I fill the format for time is "HH:mm:ss"
but when I fill the table with Begin Time "22:00:00" and End Time "3:00:00" and doing some code to check the record I found the bug I think...
I create new variable data type time, I named it "varTime" and I fill this variable with "1:00:00"
when I doing some coding like this :
IF (varTime > rec."Begin Time") AND (varTime < rec."End Time") THEN
Message('Success!');
but the message never pop-up and if I think the logic is right because when I fill the table with time less than "00:00:00" it worked !!!!!!
but if I fill with time more than "23:59:00" it didn't work...
can you fix this problem pls?
Thnks b4...

0
Comments
-
You probably will need to do something like:
IF (varTime > rec."Begin Time") AND (varTime < "23:59:59") OR
(varTime > "00:00:00") AND (varTime < rec."End Time") THEN
Message('Success!');
Not sure if you can use "24:00:00" vs. "23:59:59".
Alternative you could use CREATEDATETIME(Date, Time) to calculate your begin time and end time on the fly, and should you use CURRENTDATETIME, you would be able to use your
IF (varTime > rec."Begin Time") AND (varTime < rec."End Time")
since now it would fall between the two dates and time.
Regards,
gus0 -
g_dreyer wrote:You probably will need to do something like:
IF (varTime > rec."Begin Time") AND (varTime < "23:59:59") OR
(varTime > "00:00:00") AND (varTime < rec."End Time") THEN
Message('Success!');
Not sure if you can use "24:00:00" vs. "23:59:59".
Regards,
gus
wooowww, it success!!!! I never think about this way... #-o
Thank you very much gus...0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions