Author |
Topic |
AdamWest
Constraint Violating Yak Guru
360 Posts |
Posted - 2013-08-20 : 10:13:45
|
I have to select rows based on if the transaction date = todays date.The column is defined as numeric 8 with 0 decimal.Can you show me how to code for todays date with such a column? |
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-08-20 : 10:20:17
|
quote: Originally posted by AdamWest I have to select rows based on if the transaction date = todays date.The column is defined as numeric 8 with 0 decimal.Can you show me how to code for todays date with such a column?
Can you give some examples of the data? For example, how is today's date represented in the numeric 8 column? |
|
|
AdamWest
Constraint Violating Yak Guru
360 Posts |
Posted - 2013-08-20 : 10:23:40
|
yes, on the server it is represented as this: 19,991,216 quote: Originally posted by James K
quote: Originally posted by AdamWest I have to select rows based on if the transaction date = todays date.The column is defined as numeric 8 with 0 decimal.Can you show me how to code for todays date with such a column?
Can you give some examples of the data? For example, how is today's date represented in the numeric 8 column?
|
|
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-08-20 : 10:45:33
|
quote: Originally posted by AdamWest yes, on the server it is represented as this: 19,991,216 quote: Originally posted by James K
quote: Originally posted by AdamWest I have to select rows based on if the transaction date = todays date.The column is defined as numeric 8 with 0 decimal.Can you show me how to code for todays date with such a column?
Can you give some examples of the data? For example, how is today's date represented in the numeric 8 column?
I am not familiar with that representation of dates. What is the formula/process you would use to convert 19,991,216 to August 20, 2013?If you don't have that information, hopefully someone else on the forum may know. |
|
|
AdamWest
Constraint Violating Yak Guru
360 Posts |
Posted - 2013-08-20 : 10:54:39
|
James, I am not looking to convert the date.I am looking for select only the current date. I am going to make a VIew, so that the Crystal Report would only get the current date. The user runs this every day and is only interested in the current date. so it would only select 20,130,820 if run today. |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
|
AdamWest
Constraint Violating Yak Guru
360 Posts |
Posted - 2013-08-20 : 12:02:14
|
What is GETDATE? is that for the current date? |
|
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-08-20 : 12:23:50
|
Yes, GETDATE gets you current date and time. You will see what it does if you run the query "SELECT GETDATE()". The CONVERT function formats that to a string according to the format specifier (112) in this case: http://technet.microsoft.com/en-us/library/ms187928.aspx |
|
|
corbingravely
Starting Member
1 Post |
Posted - 2013-12-13 : 04:53:39
|
You can do this using the foreign key. You can set the unique Id as the one you prefer to be the reference point and call the rest of the table objects using that key as the major object. |
|
|
|